sdk: Cannot load or run lots of my projects in my solution after installing .NET 7
Edit + General Resolution (from @nagilson):
This is now documented as a known issue for .NET 7 and a resolution is provided here.
Describe the bug
I just installed the last update of visual studio. Then, this happened, I cannot open my projects.
C:\Users\PC2\source\repos\AktifPOS\AktifBarkod.AktifPOS.Data\AktifBarkod.AktifPOS.Data.csproj : error : SDK Resolver Failure: “The SDK resolver “Microsoft.DotNet.MSBuildSdkResolver” failed while attempting to resolve the SDK “Microsoft.NET.Sdk”. Exception: “Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadManifestCompositionException: Workload definition ‘wasm-tools’ in manifest ‘microsoft.net.workload.mono.toolchain’ [C:\Program Files\dotnet\sdk-manifests\7.0.100\microsoft.net.workload.mono.toolchain\WorkloadManifest.json] conflicts with manifest ‘microsoft.net.workload.mono.toolchain.net7’ [C:\Program Files\dotnet\sdk-manifests\7.0.100\microsoft.net.workload.mono.toolchain.net7\WorkloadManifest.json]
at Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadResolver.ComposeWorkloadManifests()
at Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadResolver.Create(IWorkloadManifestProvider manifestProvider, String dotnetRootPath, String sdkVersion, String userProfileDir)
at Microsoft.NET.Sdk.WorkloadMSBuildSdkResolver.CachingWorkloadResolver.Resolve(String sdkReferenceName, String dotnetRootPath, String sdkVersion, String userProfileDir)
at Microsoft.DotNet.MSBuildSdkResolver.DotNetMSBuildSdkResolver.Resolve(SdkReference sdkReference, SdkResolverContext context, SdkResultFactory factory)
at Microsoft.Build.BackEnd.SdkResolution.SdkResolverService.TryResolveSdkUsingSpecifiedResolvers(IList`1 resolvers, Int32 submissionId, SdkReference sdk, LoggingContext loggingContext, ElementLocation sdkReferenceLocation, String solutionPath, String projectPath, Boolean interactive, Boolean isRunningInVisualStudio, SdkResult& sdkResult)”” C:\Users\PC2\source\repos\AktifPOS\AktifBarkod.AktifPOS.Data\AktifBarkod.AktifPOS.Data.csproj

To Reproduce
Exceptions (if any)
Further technical details
- PS C:\Users\PC2> dotnet --info .NET SDK: Version: 7.0.100 Commit: e12b7af219
Runtime Environment: OS Name: Windows OS Version: 10.0.22621 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\7.0.100\
Host: Version: 7.0.0 Architecture: x64 Commit: d099f075e4
.NET SDKs installed: 3.1.424 [C:\Program Files\dotnet\sdk] 5.0.301 [C:\Program Files\dotnet\sdk] 5.0.414 [C:\Program Files\dotnet\sdk] 6.0.100-rc.1.21463.6 [C:\Program Files\dotnet\sdk] 6.0.200 [C:\Program Files\dotnet\sdk] 7.0.100-rc.2.22477.23 [C:\Program Files\dotnet\sdk] 7.0.100 [C:\Program Files\dotnet\sdk]
.NET runtimes installed: Microsoft.AspNetCore.App 3.1.16 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.21 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.31 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 5.0.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 5.0.10 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.0-rc.1.21452.15 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.10 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 7.0.0-rc.2.22476.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 7.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 3.1.16 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.21 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.23 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.30 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.31 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 5.0.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.0-rc.1.21451.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.10 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 7.0.0-rc.2.22472.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 7.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 3.1.16 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 3.1.23 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 3.1.30 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 3.1.31 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 5.0.7 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 6.0.0-rc.1.21451.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 6.0.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 6.0.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 6.0.10 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 6.0.11 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 7.0.0-rc.2.22472.13 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 7.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Other architectures found: arm64 [C:\Program Files\dotnet] registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\arm64\InstallLocation] x86 [C:\Program Files (x86)\dotnet] registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]
Environment variables: Not set
global.json file: Not found
Learn more: https://aka.ms/dotnet/info
Download .NET: https://aka.ms/dotnet/download PS C:\Users\PC2>
- VS 2019, VS 2022, VS 2022 Preview
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 22
- Comments: 37 (9 by maintainers)
Commits related to this issue
- Document .NET 7 Preview Workloads Breaking Builds See context here: https://github.com/dotnet/sdk/issues/28947 — committed to dotnet/core by nagilson 2 years ago
The uninstall tool has an artificial limitation not to uninstall SDK 7+ versions, and the issue is open since August (https://github.com/dotnet/cli-lab/issues/230). Ironically, I tried cloning the repository to apply the fix and run it, but it failed to build because of the exact issue described here.
Sorry you’re dealing with this; it sucks to get an update and then suddenly have your things break.
The official guidance we have for you atm is to uninstall any preview SDKs, like @xt0rted mentioned. Some workload files in some of the preview SDKs will conflict with the RTM / official .NET 7 SDK release. @pascallapradebrite4’s suggestion to delete the
microsoft.net.workload.mono.toolchainis also valid and we have been telling people internally to do the same.As for why, I believe In the middle of preview development some workload content got renamed, with
.net7.0being appended to the end. The reason this happened (multi targeting) is convoluted to say the least and someone else from the team could probably explain it better. We’ve been having discussions about how to prevent the same thing happening when folks upgrade to .NET 8. We are also consideringdotnet workload cleanwhich could fix this for you. Thanks, and please let us know of any other feedback or questions here!Just realized there was still a preview version of the sdk installed. I assumed this would be cleaned up when updating since I never manually installed this, but I guess it wasn’t. After updating I did restart like it suggested so it’s not due to a cleanup task not running yet.
I manually uninstalled
7.0.100-preview.6.22352.1and that removesmicrosoft.net.workload.emscriptenandmicrosoft.net.workload.mono.toolchainfromC:\Program Files\dotnet\sdk-manifests\7.0.100which fixed the issue for me.I tried to hack the problem locally pending a proper fix.
My error message states that there is a conflict between two manifests (macOS arm64, hence the paths):
/usr/local/share/dotnet/sdk-manifests/7.0.100/microsoft.net.workload.mono.toolchain/WorkloadManifest.json [...] conflicts with manifest [...] /usr/local/share/dotnet/sdk-manifests/7.0.100/microsoft.net.workload.mono.toolchain.net7/WorkloadManifest.jsonI’m not entirely sure how these are intended to work, but I saw “there is a conflict” and thought “what if I remove one of them?”.
So I deleted (moved elsewhere just in case) the
.net7manifest directory specifically, and everything is back to working.sudo mv /usr/local/share/dotnet/sdk-manifests/7.0.100/microsoft.net.workload.mono.toolchain.net7 ~/dotnet.bakNow,
dotnet restore,dotnet buildanddotnet runall work.Obviously this is just a temporary hack, your mileage may vary, and I don’t know if this can damage some setups, I’m not endorsing that everyone affected should do this while waiting for the fix. Just hoping it can help some people in the meantime.
Edit: I should mention: macOS 13.0 arm64, .NET 7.0 SDK arm64 GA directly, no Visual Studio, here are all my SDKs installed:
Deleting: C:\Program Files\dotnet\sdk-manifests\7.0.100\microsoft.net.workload.mono.toolchain did the trick for me. I got so frustrated I deleted VS 2022, removed all the frameworks and no luck. A real pain worked like two days but removing that one directory did it. The fact that the install or update that MS created was not smart enough th do that kind of ticks me off, how stupid.
Following up on the workaround by @pascallapradebrite4 if I remove
C:\Program Files\dotnet\sdk-manifests\7.0.100\microsoft.net.workload.mono.toolchainthen things start to work again. Removing themicrosoft.net.workload.mono.toolchain.net7folder didn’t help in my instance.Contents of
C:\Program Files\dotnet\sdk-manifests\7.0.100:Uninstalling all of the .NET 7 Preview releases resolved the issue for me
I have the same issue.
Fortunately, I have two computers running the same version of .NET 7.0 / Visual Studio 2022 with the same workloads. One works fine and the other is broken. I checked the path
C:\Program Files\dotnet\sdk-manifests\7.0.100and find that the PC with broken Visual Studio has an extra folder namedmicrosoft.net.workload.mono.toolchain.I deleted the extra folder, and now the .NET 7.0 / Visual Studio works fine.
The error message:
Just updated VS and I’m getting the same error when I open my .net 6 projects (without a
global.json), as well as when I try to rundotnet ...commands in projects where the sdk was bumped to7.0.100, switching back to6.0.402results in the errors going away.Project without a
global.jsontargetingnet6.0:Project with a
global.jsonpinned to7.0.100and targetingnet6.0:I have installed everything from zero. Now everything works. Thanks for help.
I only unintall the NET CORE 7 preview from my PC and It works for me. I hope that It will be usefull
ended up removing
/usr/local/share/dotnet/sdkand/usr/local/share/dotnet/sdk-manifests. then reinstalled .net 7 followed by .net 6. was finally able to load the projects again with rider.@sencagri
I’m going to pin the solution that worked for most people by editing it and appending it to the top of your comment. Following up here to try to help with your specific scenario. I saw the error you mentioned here:
I’m pretty sure the intention of that error was to get you to do a
nuget restorebut I’m not sure if that will really solve the situation as your machine is probably in a pretty weird state. I saw you mentioned reinstalling the .NET 7 SDK but more information here would be helpful.Please try doing an uninstall of all .NET 7 SDKs, since you’re on windows you can easily do this in the
Visual Studio may also have .NET 7 preview SDKs installed, after the uninstall go to the VS Installer, Modify existing VS Installations, Individual Components, and make sure there are no remaining .NET 7 SDKs.
Add or Remove Programswindow.Then re-install a single copy of the .NET 7 RTM SDK. If it doesn’t work with a clean installation, please report back what errors you get trying to build so we can take another look.
In my case, on Mac I had to