This post was most recently updated on March 13th, 2023.2 min read.
This article offers a stupid workaround for a cryptic and seemingly unrecoverable problem that manifests itself after a Visual Studio / .NET update and causes the following error to be thrown: “There was no runtime pack for Microsoft.AspNetCore.App available for the specified RuntimeIdentifier ‘browser-wasm’.”
Sorry, no real solution here – but at least I’ve got a way to recover from the issue. So read on if you stumbled into it as well!
The error I ran into came from MSBuild when I was casually hitting F5 after opening my project after a while. I was greeted with this:
Error NETSDK1082 There was no runtime pack for Microsoft.AspNetCore.App available for the specified RuntimeIdentifier 'browser-wasm'. C:\Program Files\dotnet\sdk\6.0.101\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets 427
It was thrown when I was building a simple MAUI project, but I suppose it can be thrown any time you’re doing something with Blazor WebAssembly.
Ah, this is not a solution. It’s a workaround, and not even a very thoughtful one – as this is the only way I’ve fixed this so far. But take a look and see if it’s something you can use.
Time needed: 1 hour.
How to fix your project throwing “There was no runtime pack for Microsoft.AspNetCore.App available for the specified RuntimeIdentifier…” after a Visual Studio update?
- Downgrade Visual Studio and/or .NET
Okay – this is not pretty, but one way to fix this is to downgrade Visual Studio. And by “downgrade” I mean uninstall and install an older version – you can get the previous versions from here:
And for older .NET versions, you can download different Major, Minor and Patch versions from here (the link is for .NET 7 but you’ll find the others there as well):
If you don’t want to get into that mess, try the second option…
- Create a new project with the same template you had before
Oh, dear. This one is not pretty. But it’s how I fixed my project when I didn’t want to go through the whole downgrading madness.
So something was updated, and that breaks the build. The build can probably be fixed by removing whatever leftovers are incompatible with your updated stuff. And that can be done by creating a new project of the same type you used before, and moving your stuff from the broken project to the new, supposedly functional one.
This might include some namespace changes, plenty of copy-pasting, adding existing items and some trial-and-error, but it should fix the issue.
- … and those are the options, really
Yeah, crappy workarounds, right? If you’ve found a better way, please let me know in the comments section below!
- Automatically get version number from project dependencies in Azure DevOps - March 28, 2023
- Solving “AADSTS90097: An error has occurred during admin consent processing.” issues in your app - March 21, 2023
- How to fix your MAUI Blazor app crashing on startup with “Failed to compare two elements in the array.” ? - March 14, 2023