Repository navigation
[release/9.0-rc2] [Blazor] Update WebAssembly.DevServer to serve the Blazor-Environment header - #57974
Merged
Conversation
This was referenced Sep 20, 2024
commented
Sep 20, 2024
Member
|
Test failure unrelated |
This was referenced Jul 22, 2025
Closed
Merged
This was referenced Feb 10, 2026
Merged
This was referenced Apr 6, 2026
This was referenced Nov 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Backport of #57971 to release/9.0-rc2
/cc @MackinnonBuck
[Blazor] Update
WebAssembly.DevServerto serve theBlazor-EnvironmentheaderFixes a recent regression that caused Blazor WebAssembly Standalone apps to always interpret the ASP.NET Core environment as "Production" during development.
Description
Blazor WebAssembly apps determine the ASP.NET Core environment by reading the
Blazor-Environmentheader in the response for the boot manifest (blazor.boot.json). A recent change caused the WebAssembly development server to stop serving this header, which resulted inIWebAssemblyHostEnvironment.Environmentalways returning"Production". This PR fixes the issue by updating the development server to correctly serve the header.Fixes #57941
Customer Impact
Without this fix, customers relying on
IWebAssemblyHostEnvironmentto selectively enable features based on the environment will experience problems during development. They will need to find another solution to determine whether the app is running in a development environment.Regression?
Regressed in .NET 9 Preview 6
Risk
The fix is straightforward, and automated tests now validate the expected behavior.
Verification
Packaging changes reviewed?