appsettings.Development.json is the conventional environment-specific ASP.NET Core configuration file. The filename replaces Environment with the current environment name, such as Development. ASP.NET Core loads appsettings.json first, then loads the matching environment file; matching keys in the later file override earlier values. section 3.1 section 13.4.2
Use the file to provide non-secret settings that vary by environment:
- Set the environment name through the ASPNETCORE_ENVIRONMENT value in launchSettings.json; the matching filename is then selected. section 3.1
- Place development values in appsettings.Development.json while keeping shared defaults in appsettings.json. section 3.1 section 13.4
- Expect later sources—including user secrets, environment variables, and command-line arguments—to override both JSON files when keys collide. section 13.4.2
- Keep secrets separate from ordinary configuration; examples of secrets include cryptographic keys, connection strings, and API keys. section 13.4
Expose environment-specific values
Store {"EnvironmentName":"Development","RegionName":"My Desk"} in appsettings.Development.json. An ASP.NET Core controller can read these values through IConfiguration and return them from a GET /config endpoint. section 13.4
Listing 13.10 Environment-specific configuration values in appsettings
{
"EnvironmentName": "Development",
"RegionName": "My Desk"
}
Inspect a concrete appsettings.Development.json payload containing EnvironmentName and RegionName. section 13.4


