Ted Nyberg
Ted Nyberg

Reputation: 7391

What are the differences between the environment variables in ASP.NET Core?

Going through documentation for (ASP).NET Core, I come across multiple environment variable names that seem to do virtually the same, or at least similar, things.

However, I'm having a hard time finding any detailed information on what exactly differs between:

Is this server-specific (IIS vs Kestrel, for example), or is it relating to something else?

Upvotes: 3

Views: 1465

Answers (1)

Set
Set

Reputation: 49779

ASPNET_ENV is legacy and has been removed, use 'ASPNETCORE_ENVIRONMENT' instead. It was announced in this issue and pr: Rename environment variables to ASPNETCORE_.

Hosting:Environment was used in RC1 as replacement for ASPNET_ENV, and now is also legacy. See this ASPNET_ENV variable should be changed in docs to Hosting:Environment issue for more details.

ASPNETCORE_ENVIRONMENT is used to describe the environment the application is currently running in. This variable can be set to any value you like, but three values are used by convention: Development, Staging, and Production.

Upvotes: 6

Related Questions