hosting environment
The named environment an app runs in, such as Development, Staging or Production, set by the ASPNETCORE_ENVIRONMENT variable.
In more detail
It chooses which appsettings.{Environment}.json file loads and whether user secrets and developer diagnostics are enabled. If unset, ASP.NET Core assumes Production.
Related terms
- configuration layering — Combining configuration from several providers in order, so later sources override earlier ones for the same key.
- appsettings.json — The JSON settings file an ASP.NET Core app reads at startup, where each object is a configuration section.
- user secrets — A .NET development tool that stores secrets for a project in your user profile, outside the project folder, so they never reach source control.
- production — The live environment where real users use the service, as opposed to development or testing.
Taught in
- The Options Pattern: Strongly Typed Configuration — Modern .NET Core, C# & Enterprise Microservices
- Environment Layering and User Secrets — Modern .NET Core, C# & Enterprise Microservices