C
C#3mo ago
Davide Dunne

Blazor Server

I have a Blazor Server application with a set of custom environment variables, I am trying to set the environment into DevelopmentLocal on the web.config file, however It stays on the Development environment Program.cs
...
Console.WriteLine($"This application is running on the environment: {app.Environment.EnvironmentName}");
// This application is running on the environment: Development
...
...
Console.WriteLine($"This application is running on the environment: {app.Environment.EnvironmentName}");
// This application is running on the environment: Development
...
web.config
...
<environmentVariables>
<environmentVariable name="ASPNETCORE_ENVIRONMENT" value="DevelopmentLocal"/>
</environmentVariables>
...
...
<environmentVariables>
<environmentVariable name="ASPNETCORE_ENVIRONMENT" value="DevelopmentLocal"/>
</environmentVariables>
...
This is the list of appsettings.json
No description
1 Reply
lycian
lycian3mo ago
Use multiple environments in ASP.NET Core
Learn how to control app behavior across multiple environments in ASP.NET Core apps.