appsettings.Development.json holds JSON configuration settings used only in the ASP.NET Core Development environment. It complements appsettings.json, which supplies shared settings for all environments. The development file is read after the shared file, so a matching key overrides the shared value. section 2.4.2
The runtime environment identifies the phase in which an app runs, such as Development, Staging, or Production. DOTNET_ENVIRONMENT or ASPNETCORE_ENVIRONMENT can select it; for local development, ASPNETCORE_ENVIRONMENT can be set in launchSettings.json. section 2.4.2
Enable the developer exception page locally
In the board-game API, set UseDeveloperExceptionPage to false in appsettings.json. Then add the same key with a value of true to appsettings.Development.json. The development value overrides the shared value only when the app runs in Development, keeping the potentially insecure page disabled by the shared setting elsewhere. section 2.4.2 section 2.4.3
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"UseDeveloperExceptionPage": true
}
The development file adds UseDeveloperExceptionPage alongside its logging settings. section 2.4.3
if (app.Environment.IsDevelopment())
{
app.UseSwagger();
app.UseSwaggerUI();
}
if (app.Configuration.GetValue<bool>("UseDeveloperExceptionPage")) #1
app.UseDeveloperExceptionPage(); #2
else
app.UseExceptionHandler("/error"); #3
Program.cs reads the resulting Boolean setting to choose the developer exception page or the /error handler. The configuration value controls this choice; the file alone does not enable the middleware. section 2.4.3


