-
Notifications
You must be signed in to change notification settings - Fork 25.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No example usage for setting blazor-environment header in a standalone Blazor wasm app not using IIS #34392
Comments
🏂🎁 Happy Holidays! ❄️⛄Stand-by! ... A green dinosaur 🦖 will be along shortly to assist. |
Hello @nicholasyin ... Try using the "environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Staging"
} If you're running with the Leave this issue open. |
I think this line ...
... is what will need an update. What's happening ... I think 🤔 ... is that the development server (basically Kestrel via Blazor startup) is reading the environment variable from launch settings configuration and setting the header. This is only when running the app locally. For hosting scenarios, I think you must set the header on your own using the file server (if you're trying to use something different than the published default of I'll talk to Steve offline about this tomorrow and come back with the answer, then I'll see about updating this aspect of the article. UPDATE (12/18): The last part of my remark on using either
|
What if I want to set for testing/production environment? Can I also set in |
Yes, but keep in mind that this approach that we're discussing with the For a published app, the only two current ways to set the environment are via The issue that I cross-linked on the PR is where the team is looking at improving the features ... They have that scheduled for consideration for .NET 10 (November, 2025) ... but only for consideration ... they might cut it and push it back to .NET 11 (November, 2026). That happens quite a bit with features under consideration. |
Description
The documentation only gives example of configuring IIS via web.config file. What if I'm developing under Linux/MacOS and can only use dotnet CLI/VSCode to launch and debug?
Page URL
https://learn.microsoft.com/en-us/aspnet/core/blazor/fundamentals/environments?view=aspnetcore-9.0#set-the-client-side-environment-via-blazor-startup-configuration
Content source URL
https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/blazor/fundamentals/environments.md
Document ID
8a5b47e7-b29c-b049-30e8-5b405a5086b6
Article author
@guardrex
Related Issues
The text was updated successfully, but these errors were encountered: