.NET MAUI

How to fix “There was no runtime pack for Microsoft.AspNetCore.App available for the specified RuntimeIdentifier…” after a Visual Studio update?

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!

Problem

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.

Solution

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?

  1. 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:
    https://learn.microsoft.com/en-us/visualstudio/releases/2022/release-history

    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):
    https://dotnet.microsoft.com/en-us/download/dotnet/7.0

    If you don’t want to get into that mess, try the second option…

  2. 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.

  3. … 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!

References

mm
0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments