Solving Error MSB4242 for Godot 4.3 C# Projects

creenshot of terminal showing error messages from running 'dotnet restore' command. The errors indicate an SDK Resolver Failure, specifically 'Microsoft.DotNet.MSBuildWorkloadSdkResolver' failing to resolve the SDK 'Godot.NET.Sdk/4.3.0'. The error includes 'System.InvalidOperationException: No workload set information found' and lists several lines of stack trace details.

Hit a snag trying to build and restore my Godot C# project and after much sleuthing, I found the solution. This post documents the problem and solution for my (and hopefully your) reference.

The Problem

On my openSUSE Tumbleweed development system, I tried to restore my Godot 4.3 C# project and got the following error when trying to execute dotnet build or dotnet restore.

error MSB4242: SDK Resolver Failure: "The SDK resolver "Microsoft.DotNet.MSBuildWorkloadSdkResolver" failed while attempting to resolve the SDK "Godot.NET.Sdk/4.3.0". Exception: "System.InvalidOperationException: No workload set information found in: /usr/share/dotnet/sdk-manifests/8.0.100/workloadsets/8.0.402-baseline.24467.1

It should be noted, that everything worked fine on my Windows development machine– this problem was exclusive to my OpenSuse environment.

I tried uninstalling the .NET SDK and runtimes. I tried upgrading the distro. I tried deleting and re-cloning the project. Same error each time.

The Solution

Looking at the error, it mentions a specific directory: /usr/share/dotnet/sdk-manifests/8.0.100/workloadsets/8.0.402-baseline.24467.1. This is the key.

Looking to the /usr/share/dotnet/sdk-manifests/8.0.100/workloadsets directory, I found two empty directories, and one that was not. After deleting the two empty directories, everything worked as intended.

It appears to be an issue with the .NET SDK on some Linux distros– specifically Fedora 40 and openSUSE Tumbleweed, according to the GitHub issue on the .NET SDK project (LINK).

References

Here are the links that led me to the solution:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.