How to combine multiple app.config files at runtime in .net?

With web applications, multiple web.config files are combined based on a directory hierarchy. Is there a way to define a custom hierarchy for common Windows applications? The functionality to merge the config file already exists, so I don't understand why this is not possible.

The current hierarchy user.config -> roaming.config -> app.config -> machine.config

. And there are huge restrictions on what can be used in user.config and roaming.config.

I would like to have the following hierarchy: additional2.config -> additional1config -> app.config -> machine.config

or as many config files as I want, resulting in one object Configuration

that I can read. Otherwise, I would have to search for each additional configuration manually.

configSource

not enough for me, because it could be that additional config files contain new config sections.

+3


source to share





All Articles