Exception shielding and external configuration files

Topics: Exception Handling Application Block
Jun 26, 2009 at 3:28 PM

Hi all,

I'm using EntLib 4.1 and I need to use an external File Configuration Source to collect all the settings concerning Exception Shielding policies.

At the same time I cannot set the above-mentioned File Configuration Source as "selectedSource" in the enterpriseLibrary.ConfigurationSource section of my App.config file, as I need to keep all the other EntLib settings in the App.config file.

Since I don't have direct access to the factory of the Exception Shielding class, how can I accomplish the task I described?

Thanks in advance for your support,



Jun 29, 2009 at 1:41 AM

You can use configSource Attribute - http://msdn.microsoft.com/en-us/library/system.configuration.sectioninformation.configsource.aspx.  For example:

       <exceptionHandling configSource="exceptionHandling.config" />

You must note though that though the Enterprise Library Configuration tool can load all blocks even if they are specified in the configSource attribute, it doesn't totally understands it.   So if you try to edit and save your config using it, it will put all your settings in the current configuration file being edited even those which are in the external files.


Sarah Urmeneta
Global Technology & Solutions
Avanade, Inc.