Multiple config.files for the same web site

Topics: General discussion
Jul 19, 2007 at 11:41 AM
Hi,

Is it possible to have one config.file for each configuration block I am using in my web site ?
So far I found an example where web.config references one file go get the attributes from.
Is it possible to have 4-5 of them at the same time or there exist another way to redirect config info
into different files for each different block ?

Thanks in advance.

Edward
Jul 19, 2007 at 11:49 AM
Hi Edward,

You can use the "configSource" mechanism provided by the .NET configuration support (see http://msdn2.microsoft.com/en-us/library/system.configuration.sectioninformation.configsource.aspx and http://www.nikhilk.net/ConfigSourceAttribute.aspx). However, you would have to update your configuration files manually, and you won't be able to use the configuration tool to update them; reading should be fine though.

Alternatively, you can configure a "FileConfigurationSource" and keep entlib's configuration in a different file, but all the blocks would share the same configuration file.

Fernando