Resources and Entlib.logging

Topics: Logging Application Block
Mar 14, 2008 at 3:57 PM
Hi,

I'm using the logging block 3.1 in a simple test application, and this is deployed on quite a few machines (just for testing purposes).
On two of the machines, the fuslogvw.exe shows that the .NET assembly loader is looking for a DLL called
Microsoft.Practices.EnterpriseLibrary.Logging.resources.dll, version 3.1.0.0, Culture "en-US"

As far as I know, all Entlib DLL's are produced in culture=neutral - mode.

Since this resources DLL does not exist, the loading process on those 2 machines takes about 15 seconds !?!

Does anybody have an idea about the origin of this problem?

PS: My own test executable is culture-neutral too. (assembly: AssemblyCulture("")

PS: it does NOT make a difference if the entlib DLL's are deployed in the GAC or not.

Thanks,

guido
Mar 20, 2008 at 2:47 PM
Further investigation has shown that there are loading problems "only" on Windows Server 2003.
On XP SP-2, the same program and same configurations work fine.

Any ideas please?

Here's a code snippet:

if (Logger.IsLoggingEnabled())
{
LogEntry le = new LogEntry("From the test program...", "Progress", 5, 1, System.Diagnostics.TraceEventType.Critical, "Testlogger", null);
if ( Logger.ShouldLog( le) ) Logger.Write(le);
}

Configuration (app.config)

<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="loggingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=dc47daf82f4300c2" />
<section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=3.1.0.0, Culture=neutral, PublicKeyToken=dc47daf82f4300c2" />
</configSections>
<loggingConfiguration name="Logging Application Block" tracingEnabled="true"
defaultCategory="General" logWarningsWhenNoCategoriesMatch="true">
<listeners>
<add source="Enterprise Library Logging" formatter="Text Formatter"
log="Application" machineName="" listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.FormattedEventLogTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=dc47daf82f4300c2"
traceOutputOptions="None" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.FormattedEventLogTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=dc47daf82f4300c2"
name="Formatted EventLog TraceListener" />
<add name="Msmq TraceListener" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.MsmqTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=dc47daf82f4300c2"
listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.MsmqTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=dc47daf82f4300c2"
traceOutputOptions="None" queuePath=".\ChrystalTraceQueue" formatter="Binary Formatter"
messagePriority="Normal" timeToReachQueue="49710.06:28:15" timeToBeReceived="49710.06:28:15"
recoverable="false" useAuthentication="false" useDeadLetterQueue="false"
useEncryption="false" transactionType="None" />
</listeners>
<formatters>
<add type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.BinaryLogFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=dc47daf82f4300c2"
name="Binary Formatter" />
<add template="Timestamp: {timestamp}&#xD;&#xA;Message: {message}&#xD;&#xA;Category: {category}&#xD;&#xA;Priority: {priority}&#xD;&#xA;EventId: {eventid}&#xD;&#xA;Severity: {severity}&#xD;&#xA;Title:{title}&#xD;&#xA;Machine: {machine}&#xD;&#xA;Application Domain: {appDomain}&#xD;&#xA;Process Id: {processId}&#xD;&#xA;Process Name: {processName}&#xD;&#xA;Win32 Thread Id: {win32ThreadId}&#xD;&#xA;Thread Name: {threadName}&#xD;&#xA;Extended Properties: {dictionary({key} - {value}&#xD;&#xA;)}"
type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=dc47daf82f4300c2"
name="Text Formatter" />
</formatters>
<categorySources>
<add switchValue="All" name="Progress">
<listeners>
<add name="Msmq TraceListener" />
</listeners>
</add>
<add switchValue="All" name="General">
<listeners>
<add name="Formatted EventLog TraceListener" />
</listeners>
</add>
</categorySources>
<specialSources>
<allEvents switchValue="All" name="All Events" />
<notProcessed switchValue="All" name="Unprocessed Category" />
<errors switchValue="All" name="Logging Errors & Warnings">
<listeners>
<add name="Formatted EventLog TraceListener" />
</listeners>
</errors>
</specialSources>
</loggingConfiguration>
<dataConfiguration defaultDatabase="ChrystalDatabase" />
<connectionStrings>
<add name="ChrystalDatabase" connectionString="Database=Ext_Chrystal;Server=chryssql04-DVL;Integrated Security=SSPI"
providerName="System.Data.SqlClient" />
</connectionStrings>
</configuration>