ASP.NET Core environment
The ASP.NET Core environment is a named runtime setting, commonly specified by ASPNETCORE_ENVIRONMENT, that identifies the hosting context and controls environment-specific behavior and configuration.
Building Web APIs with ASP.NET Core
ASPNETCORE_ENVIRONMENT is an environment variable that specifies the runtime environment in which an ASP.NET Core application runs.
- How it is used
- Selects the runtime environment for the web API’s configuration and behavior.
- How deep it goes
- Explains local profile setup, configuration overrides, and middleware checks, while deferring production-server setup.
- Examples
- Uses a board-game API launch profile and a throwing test endpoint to demonstrate Development and Production behavior.
- What you can do after
- Operate/configure a local ASP.NET Core launch profile and test environment-dependent exception handling.
Read how Building Web APIs with ASP.NET Core explains ASP.NET Core environment →
ASP.NET Core in Action, 3e
ASPNETCORE_ENVIRONMENT is an environment variable that identifies the current ASP.NET Core hosting environment.
- How it is used
- Selects environment-specific application behavior and configuration across development, staging, and production deployments.
- How deep it goes
- Defines variable loading, precedence, defaults, helper checks, and environment-specific files, but does not detail broader application customization.
- Examples
- Uses Development, Staging, Production, launchSettings.json, and appsettings.Production.json as concrete environment examples.
- What you can do after
- Operate/configure an application by setting its hosting environment and selecting matching configuration files.
Read how ASP.NET Core in Action, 3e explains ASP.NET Core environment →
Also covered in
Related concepts
- appsettings.Development.jsonconfigures · appsettings.Development.json is an ASP.NET Core environment-specific JSON configuration file whose settings apply when the Development environment is active.
- environmentconfigures · An environment is the surrounding conditions, systems, or context within which an entity or process exists, operates, or interacts.
- environment variablekind of · An environment variable is a named value supplied through a process's execution environment and made available to software, often for runtime configuration or contextual information.
- IHostEnvironmentconfigures · IHostEnvironment is the .NET abstraction that exposes information about an application's current hosting environment and content root.
- JavaScript runtimeconfigures · A JavaScript execution environment that runs JavaScript code and provides language services and interfaces to its host platform.
Questions about ASP.NET Core environment
What is ASP.NET Core environment?
The ASP.NET Core environment is a named runtime setting, commonly specified by ASPNETCORE_ENVIRONMENT, that identifies the hosting context and controls environment-specific behavior and configuration.
Which Manning books explain ASP.NET Core environment?
Building Web APIs with ASP.NET Core and ASP.NET Core in Action, 3e.
What is the difference between ASP.NET Core environment and DOTNET_ENVIRONMENT?
The ASP.NET Core environment is a named runtime setting, commonly specified by ASPNETCORE_ENVIRONMENT, that identifies the hosting context and controls environment-specific behavior and configuration. DOTNET_ENVIRONMENT is a .NET environment variable that identifies the application's hosting environment for selecting environment-specific configuration.
What is ASP.NET Core environment a kind of?
ASP.NET Core environment is a kind of environment variable. An environment variable is a named value supplied through a process's execution environment and made available to software, often for runtime configuration or contextual information.
What is ASP.NET Core environment also called?
ASP.NET Core environment is also called ASPNETCORE_ENVIRONMENT.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

