-
Notifications
You must be signed in to change notification settings - Fork 90
Description
Found out about this trying to build a docfx project on my MBP:
dotnet/docfx#8502 (comment)
When running a .NET core console app and calling MSBuildLocator.RegisterDefaults()
I get the following exception:
Unhandled exception. System.InvalidOperationException: Failed to find an appropriate version of .NET Core MSBuild. Call to hostfxr_resolve_sdk2 failed. There may be more details in stderr.
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.TryGetFirst[TSource](IEnumerable1 source, Boolean& found) at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable1 source)
at Microsoft.Build.Locator.MSBuildLocator.RegisterDefaults()
at Program.
OS: MacOS ventura 13.2.1, Apple M2 Pro
Never had this problem on an Intel machine so I suspect it is due to that. Any fix or workaround available?