liveBook · Manning

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.

How 2 Manning books explain it

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 runtime-specific configuration and API behavior for development, testing, or production.
How deep it goes
Walks through local setup, configuration overrides, and middleware testing; defers production-server setup.
Examples
Uses Development launch profiles and a throwing /error/test endpoint to compare developer and production-style error responses.
What you can do after
Operate/configure it by setting a local launch profile, overriding development settings, and verifying the selected exception handler.

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 →

Related concepts

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.