[release/8.0] Don't require latest runtime patch for Blazor DevServer #56181
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Don't require latest runtime patch for Blazor DevServer
This fixes a failure to launch the Blazor DevServer when a project's Microsoft.AspNetCore.Components.WebAssembly.DevServer NuGet dependency has a new patch version than the aspnetcore runtime provided by the SDK.
Description
This is a backport of DevServer changes from #56123 for release/8.0.
If you have not installed an SDK with the 8.0.6 runtimes, but you reference the 8.0.6 version of the Microsoft.AspNetCore.Components.WebAssembly.DevServer NuGet dependency, and try to
dotnet run
the project, you’ll see the following output:You can work around this issue by installing the 8.0.301 SDK from https://dotnet.microsoft.com/en-us/download/dotnet/8.0 that brings in the 8.0.6 runtime. Or you can downgrade the Microsoft.AspNetCore.Components.WebAssembly.DevServer NuGet dependency to 8.0.5.
However, it ought not be necessary for the NuGet dependency to exactly align with the runtime patch version. dotnet/runtime#88204 (comment) has more context.
Fixes #56119
Customer Impact
If a customer tries to use an older SDK with a newer version of the Microsoft.AspNetCore.Components.WebAssembly.DevServer NuGet dependency, they'll see the following error in Visual Studio:
Similar reports come into VS feedback and GitHub pretty regularly. VS does not seem to give any details other than the following in from the “Debug” output by default.
Regression?
Risk
It allows the dev server to work in environments where it would previously completely fail without easy-to-find debug info. The Blazor dev server is stable and only uses public API, so it does not require a specific runtime patch.
Verification
Packaging changes reviewed?