Problem description
Prior to version 6.0 with the old style application startup it was possible for an application to define how configuration file should be loaded by clearing up the configuration sources and by adding the configuration items in the desired order.
A use case is for instance a shared library with a baseline configuration which needs to be "injected" into the Configuration before the appsettings.* files. so that developers just need to implement minimum overrides in their appsettings files.
With version 6 it is now impossible to
- Set the Configuration of a WebApplicationBuilder instance (readonly property)
- Access the Sources of the ConfigurationManager (IConfigurationBuilder.Sources) property as it is private
Proposal
As it is always possible to add new configuration sources to the ConfigurationManager class, the cleanest approach which would not break the current encapsulation would be to add a clear() method to the ConfigurationManager class.