Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Invalid TraceListenerData type in configuration for Enterprise Library Logging Distributor

I am trying to use the Enterprise Library MSMQ Distributor service to pick up log messages being placed in an MSMQ queue and place them in a database through the standard Database part of the Logging block.

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 line in question 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 can't figure out what is wrong with the listener definition - it seems as if the Distributor can't find it, but as far as I know the relevant dll is in the same folder. Running the same configuration against a different application works correctly and writes log entries to the database, so it seems as though it could be something to do with service permissions but I don't know which way I need to look for this one.

like image 967
glenatron Avatar asked Jan 29 '13 12:01

glenatron


1 Answers

This problem came down to having the wrong versions of .dlls available. If you have both the source and binary versions of Enterprise Library you need to ensure you use the same libraries as the version of EntLibConfig.exe that you use to create your configuration file. So if you are using the EntLibConfig file from the binary distribution you need to make dlls from the binary distribution available to the application that is configured by them. Otherwise all your references will be tangled and you will get this type of error.

like image 75
glenatron Avatar answered Sep 23 '22 12:09

glenatron