Ryan Peters
Ryan Peters

Reputation: 7708

Cannot change ASPNETCORE_ENVIRONMENT to other than "Staging"

I have "Development" set in my web.config, in the launchSettings.json (all profiles), and in the environment variables on Windows, but the application still shows the environment as "Staging". Also, even if I run Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") in something like RoslynPad, it also shows "Staging". I do not know where else I can look to set this value. Thank you.

enter image description here

enter image description here

The Environment Context is still "Staging".

enter image description here

Upvotes: 0

Views: 1229

Answers (1)

Ryan Peters
Ryan Peters

Reputation: 7708

As Rena suggested, restarting VS helped fix the issue, and ensuring I did a clean and removing any/all environment variables defined on the OS now allows me to change the environment using the web.config.

Upvotes: 1

Related Questions