Externalized Containers

Dec 15, 2008 at 10:19 PM
Does anyone know if it is possible to separate a container element to a configuration file?  I know this can be done with configuration sections and using the configSource attribute as in the example below.  Looking at the Unity schema, this does not look possible, but I thought I'd ask everyone here.  Thanks!

exceptionHandling configSource="exceptions.config" />

Dec 16, 2008 at 6:58 AM
There's no support directly in the app.config file (unless system.configuration does something I'm not remembering right now.) It is possible and easy to load up a separate config file through the ConfigurationManager. Look at the ConfigurationManager.OpenExeConfiguration method and the Unity unit tests where we use this a lot.

Dec 16, 2008 at 3:49 PM
That's what I thought.  Thanks for confirming this for me!