A way I could think of to do this would be to create a separate file that will contain your additions during runtime and make use of the ParentConfigurationSource that is new in EntLib 5.0. Here's the steps:
1. Create a separate file, say logging. config. This is where you will put your own listeners during runtime.
2. Go to your application's configuration file and add the Configuration Sources if it doesn't exist yet. (Blocks -> Add Configuration Settings).
3. Add the System Configuration Source in the Source section.
4. Add a File-based Configuration Source in the Sources section. Specify the full path of the logging.config in the FilePath property.
5. Under the Configuration Settings, locate the ParentSource property, set it to your file-based configuration source. Set the Selected Source to the System Configuration Source. You can also refer to the documentation (Developing Applications
with Enterprise Library -> Configuring Enterprise Library -> Advanced Configuration Scenarios -> Applying a Common Structure for Applications) for a reference on how this kind of configuration works but basically, it merges the two (the Parent and
6. Now, when using the Fluent configuration Api, you would create an instance of FileConfigurationSource referring to your logging.config file
IConfigurationSource configSource = new FileConfigurationSource("pathtoLogging.config");
Let me know if anything is unclear.
Global Technology & Solutions