Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No .NET SDKs were found. #1580

Open
agirorn opened this issue Nov 17, 2024 · 1 comment
Open

No .NET SDKs were found. #1580

agirorn opened this issue Nov 17, 2024 · 1 comment

Comments

@agirorn
Copy link

agirorn commented Nov 17, 2024

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
```
@josefpihrt
Copy link
Collaborator

Hi,

Do you think you could create a small project that reproduces that error and send it here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants