roslynator icon indicating copy to clipboard operation
roslynator copied to clipboard

No .NET SDKs were found.

Open agirorn opened this issue 1 year ago • 1 comments

I have been trying to get roslynator analyze Solution.sln to work, and I'm just stuck with this error. any help would surely be appreciated.

The Solution builds and finds the dotnet 8 SDK.

No .NET SDKs were found.

Download a .NET SDK:
https://aka.ms/dotnet/download

Learn about SDK resolution:
https://aka.ms/dotnet/sdk-not-found
System.AggregateException: One or more errors occurred. (Failed to find all versions of .NET Core MSBuild. Call to hostfxr_resolve_sdk2. There may be more details in stderr.)
 ---> System.InvalidOperationException: Failed to find all versions of .NET Core MSBuild. Call to hostfxr_resolve_sdk2. There may be more details in stderr.
   at Microsoft.Build.Locator.DotNetSdkLocationHelper.GetSdkFromGlobalSettings(String workingDirectory)
   at Microsoft.Build.Locator.DotNetSdkLocationHelper.GetDotNetBasePaths(String workingDirectory)+MoveNext()
   at Microsoft.Build.Locator.DotNetSdkLocationHelper.GetInstances(String workingDirectory)+MoveNext()
   at Microsoft.Build.Locator.MSBuildLocator.GetInstances(VisualStudioInstanceQueryOptions options)+MoveNext()
   at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
   at System.Collections.Generic.HashSet`1.UnionWith(IEnumerable`1 other)
   at System.Collections.Generic.HashSet`1..ctor(IEnumerable`1 collection, IEqualityComparer`1 comparer)
   at System.Linq.Enumerable.DistinctIterator`1.ToList()
   at Roslynator.CommandLine.MSBuildWorkspaceCommand`1.TryGetVisualStudioInstance(VisualStudioInstance& result) in /_/src/CommandLine/Commands/MSBuildWorkspaceCommand.cs:line 290
   at Roslynator.CommandLine.MSBuildWorkspaceCommand`1.CreateMSBuildWorkspace(String msbuildPath, IEnumerable`1 rawProperties) in /_/src/CommandLine/Commands/MSBuildWorkspaceCommand.cs:line 263
   at Roslynator.CommandLine.MSBuildWorkspaceCommand`1.ExecuteAsync(IEnumerable`1 paths, String msbuildPath, IEnumerable`1 properties) in /_/src/CommandLine/Commands/MSBuildWorkspaceCommand.cs:line 50
   at Roslynator.CommandLine.Program.AnalyzeAsync(AnalyzeCommandLineOptions options) in /_/src/CommandLine/Program.cs:line 343
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at Roslynator.CommandLine.Program.<>c.<Main>b__0_3(MSBuildCommandLineOptions options) in /_/src/CommandLine/Program.cs:line 175
   at CommandLine.ParserResultExtensions.MapResult[T1,T2,TResult](ParserResult`1 result, Func`2 parsedFunc1, Func`2 parsedFunc2, Func`2 notParsedFunc)
   at Roslynator.CommandLine.Program.Main(String[] args) in /_/src/CommandLine/Program.cs:line 169

I'm running roslynator.dotnet.cli 0.9.3 on a Mac

 dotnet tool list -g
Package Id                 Version      Commands
--------------------------------------------------
roslynator.dotnet.cli      0.9.3        roslynator
```

agirorn avatar Nov 17 '24 17:11 agirorn