liveBook · Manning

Appsettings.Development.json

As explained in Building Web APIs with ASP.NET Core

appsettings.Development.json is an ASP.NET Core environment-specific configuration file whose settings apply to the Development environment and override or extend shared settings.

`appsettings.Development.json` holds ASP.NET Core configuration for the Development runtime environment. The shared `appsettings.json` applies across environments; when the app runs in Development, its development-specific file is read afterward. Matching keys override shared values, while new keys add settings for Development only. section 2.4.2

The runtime environment can be selected with `DOTNET_ENVIRONMENT` or `ASPNETCORE_ENVIRONMENT`. For local runs, `ASPNETCORE_ENVIRONMENT` can be set in `launchSettings.json`. A Development-only setting is ignored when the app runs in another environment. section 2.4.2

Keep detailed errors in Development

In the board-game API, set `UseDeveloperExceptionPage` to `false` in `appsettings.json`, then add `"UseDeveloperExceptionPage": true` to `appsettings.Development.json`. In `Program.cs`, read the value with `app.Configuration.GetValue<bool>("UseDeveloperExceptionPage")` to choose between the developer exception page and the `/error` handler. Run in Development and trigger a test exception to check the detailed page; the shared setting remains false for other environments. section 2.4.2 section 2.4.3

{
  "Logging": {
    "LogLevel": {
      "Default": "Information",
      "Microsoft.AspNetCore": "Warning"
    }
  },
"UseDeveloperExceptionPage": true
}

This listing shows the Development file with its `UseDeveloperExceptionPage` override alongside logging settings. section 2.4.3

How Building Web APIs with ASP.NET Core covers it

How deep it goes
Explains environment selection and file precedence, then walks through a configuration override and its use in `Program.cs`.
Examples
Uses a board-game API setting that enables the developer exception page in Development while leaving the shared value false.
What it assumes
Introduces runtime environments and JSON key-value configuration before applying them to the generated API project.
What you can do after
Operate/configure it to override shared settings in Development and select the corresponding error-handling behavior.
How it connects
Connects `appsettings.json` to runtime environments, `launchSettings.json`, `Program.cs`, and exception-handling middleware.

Also explained in

Compare how 3 books explain appsettings.Development.json →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Building Web APIs with ASP.NET Core. The section links point to the parts of the book it draws on.