ReSharper CLI inspectcode error WorkloadAutoImportPropsLocator could not be found

54 views Asked by At

I am getting following error while running ReSharper CLI inspect

Could not resolve SDK "Microsoft.NET.SDK.WorkloadAutoImportPropsLocator". Exactly one of the probing messages below indicates why we could not resolve the SDK. Investigate and resolve that message to correctly specify the SDK. The NuGetSdkResolver did not resolve this SDK because there was no version specified in the project or global.json. MSB4276: The default SDK resolver failed to resolve SDK "Microsoft.NET.SDK.WorkloadAutoImportPropsLocator" because directory "C:\Program Files\dotnet\sdk\7.0.306\Sdks\Microsoft.NET.SDK.WorkloadAutoImportPropsLocator\Sdk" did not exist.

I am exploring ReSharper CLI for code analysis and created a sample dotnet webapi project with dotnet 6.0 LTS version and then installed ReSharper CLI using dotnet install command as per https://www.jetbrains.com/help/resharper/ReSharper_Command_Line_Tools.html#install-and-use-resharper-command-line-tools-as-net-core-tools

While executing jb inspectcode [pathofSolutionFileIncludingFilename] command I get following error.

JetBrains Inspect Code 2023.3.3 Running on x64 OS in x64 architecture, .NET 7.0.9 under Microsoft Windows 10.0.22000 Warning: Starting from version 2021.2, InspectCode builds the target solution before starting the analysis to make sure it only finds relevant code issues. To explicitly accept the new behavior and suppress this warning, use the '--build' option. To match the behavior in previous versions and skip the build, use '--no-build'. Warning: Toolset 'C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin' cannot be found. Warning: Specified toolset path 'C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin' is not found. Using toolset version 17.0 from "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\amd64" Configuration: Debug, Platform: Any CPU [MSB4236] The SDK 'Microsoft.NET.SDK.WorkloadAutoImportPropsLocator' specified could not be found. C:\Program Files\dotnet\sdk\7.0.306\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.ImportWorkloads.props at (14:38) [MsBuild] C:\Program Files\dotnet\sdk\7.0.306\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.ImportWorkloads.props (14,3)->(14,3) : Could not resolve SDK "Microsoft.NET.SDK.WorkloadAutoImportPropsLocator". Exactly one of the probing messages below indicates why we could not resolve the SDK. Investigate and resolve that message to correctly specify the SDK. The NuGetSdkResolver did not resolve this SDK because there was no version specified in the project or global.json. MSB4276: The default SDK resolver failed to resolve SDK "Microsoft.NET.SDK.WorkloadAutoImportPropsLocator" because directory "C:\Program Files\dotnet\sdk\7.0.306\Sdks\Microsoft.NET.SDK.WorkloadAutoImportPropsLocator\Sdk" did not exist.

0

There are 0 answers