Note that there are some explanatory texts on larger screens.

plurals
  1. POActivation error occured while trying to get instance of type LogWriter
    text
    copied!<p>I am trying to using the Logging Application block of Enterprise Library 5.0 to log simple message to the Windows event log on Win XP SP3 system using:</p> <pre><code>Logger.Write(msg); </code></pre> <p>I get the "Activation error occured while trying to get instance of type LogWriter" error message when trying to log.</p> <p>Shown below is the config file used with MS Enterprise library</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt; &lt;configuration&gt; &lt;configSections&gt; &lt;section name="loggingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="true" /&gt; &lt;/configSections&gt; &lt;loggingConfiguration name="" tracingEnabled="true" defaultCategory="General"&gt; &lt;listeners&gt; &lt;add name="Event Log Listener" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.FormattedEventLogTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.FormattedEventLogTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" source="Enterprise Library Logging" formatter="Text Formatter" log="Application" machineName="." traceOutputOptions="None" /&gt; &lt;/listeners&gt; &lt;formatters&gt; &lt;add type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" template="Timestamp: {timestamp}{newline}&amp;#xA;Message: {message}{newline}&amp;#xA;Category: {category}{newline}&amp;#xA;Priority: {priority}{newline}&amp;#xA;EventId: {eventid}{newline}&amp;#xA;Severity: {severity}{newline}&amp;#xA;Title:{title}{newline}&amp;#xA;Machine: {localMachine}{newline}&amp;#xA;App Domain: {localAppDomain}{newline}&amp;#xA;ProcessId: {localProcessId}{newline}&amp;#xA;Process Name: {localProcessName}{newline}&amp;#xA;Thread Name: {threadName}{newline}&amp;#xA;Win32 ThreadId:{win32ThreadId}{newline}&amp;#xA;Extended Properties: {dictionary({key} - {value}{newline})}" name="Text Formatter" /&gt; &lt;/formatters&gt; &lt;categorySources&gt; &lt;add switchValue="All" name="General"&gt; &lt;listeners&gt; &lt;add name="Event Log Listener" /&gt; &lt;/listeners&gt; &lt;/add&gt; &lt;/categorySources&gt; &lt;specialSources&gt; &lt;allEvents switchValue="All" name="All Events" /&gt; &lt;notProcessed switchValue="All" name="Unprocessed Category" /&gt; &lt;errors switchValue="All" name="Logging Errors &amp;amp; Warnings"&gt; &lt;listeners&gt; &lt;add name="Event Log Listener" /&gt; &lt;/listeners&gt; &lt;/errors&gt; &lt;/specialSources&gt; &lt;/loggingConfiguration&gt; &lt;/configuration&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload