Fixing .NET SDK Resolver Failure
How to resolve SDK Resolver Failure when working with .NET project command line

Recently, with .NET 10.0.103 installed on my macOS (it also happened on Windows and probably Linux too), I tried to run a C# script and ran into this issue.
$ dotnet run Program.cs
SDK Resolver Failure: "The SDK resolver "Microsoft.DotNet.MSBuildWorkloadSdkResolver" failed while attempting to resolve the SDK "Microsoft.NET.SDK.WorkloadAutoImportPropsLocator". Exception: "System.IO.FileNotFoundException: Workload manifest microsoft.net.workload.emscripten.current: 10.0.102/10.0.100 from workload version 10.0.102 was not installed. Running "dotnet workload repair" may resolve this.
at Microsoft.NET.Sdk.WorkloadManifestReader.SdkDirectoryWorkloadManifestProvider.GetManifests()
at Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadResolver.LoadManifestsFromProvider(IWorkloadManifestProvider manifestProvider)
at Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadResolver.InitializeManifests()
at Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadResolver.GetInstalledWorkloadPacksOfKind(WorkloadPackKind kind)+MoveNext()
at Microsoft.NET.Sdk.WorkloadMSBuildSdkResolver.CachingWorkloadResolver.Resolve(String sdkReferenceName, IWorkloadManifestProvider manifestProvider, IWorkloadResolver workloadResolver)
at Microsoft.NET.Sdk.WorkloadMSBuildSdkResolver.CachingWorkloadResolver.Resolve(String sdkReferenceName, String dotnetRootPath, String sdkVersion, String userProfileDir, String globalJsonPath)
at Microsoft.NET.Sdk.WorkloadMSBuildSdkResolver.WorkloadSdkResolver.Resolve(SdkReference sdkReference, SdkResolverContext resolverContext, SdkResultFactory factory)
at Microsoft.Build.BackEnd.SdkResolution.SdkResolverService.TryResolveSdkUsingSpecifiedResolvers(IReadOnlyList`1 resolvers, Int32 submissionId, SdkReference sdk, LoggingContext loggingContext, ElementLocation sdkReferenceLocation, String solutionPath, String projectPath, Boolean interactive, Boolean isRunningInVisualStudio, SdkResult& sdkResult, IEnumerable`1& errors, IEnumerable`1& warnings)"" /usr/local/share/dotnet/sdk/10.0.103/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.props
The build failed. Fix the build errors and run again.

As suggested by the error message, I tried dotnet workload repair hoping it would fix the issue, but another error message appeared:
$ sudo dotnet workload repair
Checking the state of installed workloads...
An issue was encountered verifying workloads. For more information, run "dotnet workload update".
Workload repair failed: Workload manifest microsoft.net.workload.emscripten.current: 10.0.102/10.0.100 from workload version 10.0.102 was not installed. Running "dotnet workload repair" may resolve this.
I also tried dotnet workload update, but the same error message appeared.
At this point, I felt trapped in an infinite void of unknown issues.
Solution
I found a related discussion on the dotnet GitHub Issue, and there is a temporary solution that fixed it:
dotnet workload config --update-mode manifests
You only need to run it once, and the problem will go away (so far) permanently.
After executing the command above, you should be able to use dotnet normally again.
Conclusion
That’s it for today’s quick blog post. I hope the next version of the .NET SDK fixes this issue properly.
As usual, if you have any questions or a better method, leave a comment below. Thanks for reading, and see you next time!


