Closed stefanvincenthaug closed 4 months ago
Hi! Unfortunately this is how arrays are handled by the underlying Microsoft.Extensions.Configuration system. We've explored a syntax that avoids arrays, in the past - may be nice to revisit at some point.
Thank you, you are correct of course. I've observed this numerous times previously, I'll adjust my mindset on how I think of the application settings.
I expected the array of sinks to be overwritten as a whole by the configuration in the environment-specific appsettings, but elements are being preserved.
In the following example, the argument "restrictedToMinimumLevel" is also applied to the console-sink specified in appsettings.development.
The argument is strictly not neccessary in this scenario, but is present to illustrate the issue. By removing the argument, the debug-statement is being output to the console as expected.
appsettings.json:
appsettings.development.json:
program.cs: