Context: I'm working on a library (let's call it InternalLib) to be used by coworkers, but from their point of view, it's an external assembly. In InternalLib, I need to use an external library too (let's call it ExternalLib), which I merged into InternalLib using ILMerge.
Both InternalLib and ExternalLib need to use configuration from the app.config. I know my coworkers can define configSections
and linked applicationSettings
for InternalLib and ExternalLib in their app.config, but is there a way I can read config from a different config file? (for example, InternalLib.dll.config) I would rather like to give them a dll and a .config than to ask them to add n config sections into their configuration file.
I could change InternalLib to read a configuration file into a Configuration
object using ExeConfigurationFileMap
, but I have no control over where ExternalLib gets it's configuration from. I mean that even if I get ExternalLib's config into a Configuration
object, I can't tell ExternalLib to use that object instead of, for example, Settings.Default.[...]
, can I?