Error:
There was no runtime pack for Microsoft.AspNetCore.App available for the specified RuntimeIdentifier ‘browser-wasm’. xxxxxxxxxxxx C:\Program Files\dotnet\sdk\7.0.402\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets
Fix:
Was able to resolve the issue by removing the project dependency (which I didn’t need in the first place, but accidentally got placed there).
In my case, the error wasn’t the result of the Blazor project itself, but a referenced project in the same solution. The referenced project targets .net standard 2.1, which should be fine in itself; however, it also had some NuGet packages installed which might conflict with Blazor dependencies: (Microsoft.Extensions.*).
Solution
- Project A (.net standard 2.1 - Class library)
- Dependencies
- Packages
- Microsoft.Extensions.Configuration.Json (<-- example dependency)
- Project B (.net 5 - Blazor webassembly)
- Dependencies
- Projects
- Project A (<-- caused the error, presumably because of the above dependency)
Comments