Invalid TraceListenerData type in configuration for Enterprise Library Log Distributor

I am trying to use the MSMQ Enterprise Library Distributor Service to collect log messages pushed to an MSMQ queue and put them in a database via the logging block database standard part.

However, when I try to start the Distributor service, I get the following exception:

Exception Type: System.Configuration.ConfigurationErrorsException
Message: Invalid TraceListenerData type in configuration 'listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Database.Configuration.FormattedDatabaseTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging.Database"'. (C:\Projects\LogTest\msmqDistributor\MsmqDistributor.exe.Config line 15)

      

The relevant line looks like this:

  <listeners>
   <add name="Database Trace Listener" type="Microsoft.Practices.EnterpriseLibrary.Logging.Database.FormattedDatabaseTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging.Database, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Database.Configuration.FormattedDatabaseTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging.Database"
    databaseInstanceName="LoggingDB" writeLogStoredProcName="WriteLog"
    addCategoryStoredProcName="AddCategory" formatter="Text Formatter"
    traceOutputOptions="DateTime, Timestamp" />
  <!-- other listeners -->
  </listeners>

      

I cannot figure out what is wrong with the listener definition - it seems that the Distributor cannot find it, but as far as I know, the corresponding dll is in the same folder. Doing the same configuration with another application works correctly and writes log entries to the database, so it seems like it might be related to work permissions, but I don't know how I need to search for this one.

+3


source to share


2 answers


This issue boiled down to the fact that the wrong versions of the .dll were available. If you have both source and binary versions of Enterprise Library, you need to make sure you are using the same libraries as the version of EntLibConfig.exe that you use to create the configuration file. Therefore, if you are using the EntLibConfig file from the binary distribution, then you need to make the dll from the binary distribution available to the application that is configured by them. Otherwise, all of your links will be confused and you will get this type of error.



+1


source


I know you marked this as an answer, but I ran into this problem and you can fix it without going back to another version of EntLib that matches EntLibConfig. In my case, I was using EntLib version 5.0.505.0 and EntLibConfig.exe needed EntLib version 5.0.414.0 just like your config file. Just any version = 5.0.414.0 appearing in your config file in the correct version and it will work. This should be the Configuration section for logging the configuration, and the Listener and Formatter sections.

The rollback is that you can no longer open your config file in EntLibConfig.exe as it will try to use the older version



entlibconfig error

+1


source







All Articles