Can't load app config into EL Config Tool

Topics: Enterprise Library Core, Logging Application Block
Feb 13, 2008 at 3:05 PM
Hi,

I get an error opening my app config file in EL Configuration tool after adding custom trace listeners.

I'm using EL 3.0. My Logging config is in a separate file commonappconfig.config referenced by app.config:

<configSections>
<section name="loggingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging" />
<section name="enterpriseLibrary.ConfigurationSource" type="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ConfigurationSourceSection, Microsoft.Practices.EnterpriseLibrary.Common, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null"/>
</configSections>
<enterpriseLibrary.ConfigurationSource selectedSource="Common Policy" >
<sources>
<add name="Common Policy"
type="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.FileConfigurationSource, Microsoft.Practices.EnterpriseLibrary.Common"
filePath="commonappconfig.config"/>

<add name="System Configuration Source"
type="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.SystemConfigurationSource, Microsoft.Practices.EnterpriseLibrary.Common" />
</sources>
</enterpriseLibrary.ConfigurationSource>


commonappconfig.config has some custom TraceListeners

<listeners>
.....
<add name="Documentation Log Destination" type="Adaptiv.Operations.Core.Logging.DocumentationLogEntryTraceListener, bo.Core.Logging.Sinks" listenerDataType="Adaptiv.Operations.Core.Logging.FormattedDocumentationTraceListenerData, bo.Core.Logging.Sinks" formatter="Default Formatter" />
......
</listeners>

DocumentationLogEntryTraceListener class is defined as follows

ConfigurationElementType(typeof(FormattedDocumentationTraceListenerData))
public class DocumentationLogEntryTraceListener : Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.CustomTraceListener
{ }

FormattedDocumentationTraceListenerData class is defined as follows:

Assembler(typeof(FormattedDocumentationTraceListenerAssembler))
public class FormattedDocumentationTraceListenerData : CustomTraceListenerData
{ }

When I open app.config in EL Config tool, it gets loaded by all the Logging section is missing.
When I open commonappconfig.config in EL Config tool, I get an error "Invalid TraceListenerData type in configuration 'listenerDataType="Adaptiv.Operations.Core.Logging.FormattedDocumentationTraceListenerData, bo.Core.Logging.Sinks"'.

I have 2 questions:
1. Why Logging info is not loaded as part of app.config? It's defined in a separate file, but EL 1.1 used to load separate configs referenced by app.config.
2. What causes the error loading commonappconfig.config? Looks like some reflection problem. Am I missing some attribute?

Thank you.