Exception manegement application block can't write to Windows server 2003

From: Lucas (msdn_at_rmya.com.ar)
Date: 12/03/03


Date: Wed, 3 Dec 2003 14:59:58 -0300

Hi,
I have posted a similar question to ASP.Net newsgroup but I found the "EMAB,
Impersonation and Event log" question here and decided to ask my question
again.
I saw the solution proposed in
http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q329291
but I'm not trying to create any new Eventy Source (just the one created by
EMAB that was created by me vis installutil).
So my problem seems to be about writing. Here is a description:

I have an ASP.Net application written with VS.Net 2002 (Net FWK 1.0). This
Web Application uses Exception Management Application Block to log Events to
Windows Event Log. We registered the Exception Management Application Block
using installutil.
Our Application uses impersonation and used to work fine on Windows 2000
Server.

Now we installed it on a Windows Server 2003 and when an exception is
raised, we get an "Access is denied" error when the application tries to log
the Exception to Event Log.

At the bottom you'll find the Stack Trace.

Any idea will be welcome

LucasC

Win32Exception (0x80004005): Access is denied]

[InvalidOperationException: Cannot open log for source {0}. You may not have
write access.]
   System.Diagnostics.EventLog.OpenForWrite() +366
   System.Diagnostics.EventLog.WriteEvent(Int32 eventID, Int16 category,
EventLogEntryType type, String[] strings, Byte[] rawData) +280
   System.Diagnostics.EventLog.WriteEntry(String message, EventLogEntryType
type, Int32 eventID, Int16 category, Byte[] rawData) +463
   System.Diagnostics.EventLog.WriteEntry(String source, String message,
EventLogEntryType type, Int32 eventID, Int16 category, Byte[] rawData) +68
   System.Diagnostics.EventLog.WriteEntry(String source, String message,
EventLogEntryType type, Int32 eventID, Int16 category) +21
   System.Diagnostics.EventLog.WriteEntry(String source, String message,
EventLogEntryType type, Int32 eventID) +15
   System.Diagnostics.EventLog.WriteEntry(String source, String message,
EventLogEntryType type) +11

Microsoft.ApplicationBlocks.ExceptionManagement.DefaultPublisher.WriteToLog(
String entry, EventLogEntryType type) +33

Microsoft.ApplicationBlocks.ExceptionManagement.DefaultPublisher.Publish(Exc
eption exception, NameValueCollection additionalInfo, NameValueCollection
configSettings) +1758

Microsoft.ApplicationBlocks.ExceptionManagement.ExceptionManager.PublishInte
rnalException(Exception exception, NameValueCollection additionalInfo) +76

Microsoft.ApplicationBlocks.ExceptionManagement.ExceptionManager.Publish(Exc
eption exception, NameValueCollection additionalInfo) +1934



Relevant Pages

  • Access denied logging to event log on Windows Server 2003
    ... Made sure the relevant event log sources are created at installation time ... Exception Type: System.InvalidOperationException ... EventLogEntryType type, Int32 eventID, Int16 category, ByterawData) ... at System.Diagnostics.EventLog.WriteEntry(String source, String message, ...
    (microsoft.public.inetserver.iis.security)
  • Requested registry access is not allowed.
    ... Exception Details: System.Security.SecurityException: Requested registry ... System.Diagnostics.EventLog.WriteEntry(String source, String message, ... EventLogEntryType type, Int32 eventID, Int16 category, ByterawData) +68 ...
    (microsoft.public.dotnet.general)
  • Urgent
    ... Exception Details: System.Security.SecurityException: Requested registry ... System.Diagnostics.EventLog.WriteEntry(String source, String message, ... EventLogEntryType type, Int32 eventID, Int16 category, ByterawData) +68 ...
    (microsoft.public.dotnet.general)
  • Re: Web App Accesing eventlogs
    ... priviledges to write to the event log. ... EventLogEntryType type, Int32 eventID, Int16 category, ByterawData) +462 ... > System.Diagnostics.EventLog.WriteEntry(String source, String message, ... EventLogEntryType type, Int32 eventID, Int16 category, ByterawData) +68 ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Event Log Trust Level?
    ... What I do in this case is install the event log as part of an installer ... package and then just use write to the event log from the app. ... > but it comes back with this exception: ... > source, String logName, String machineName, Boolean ...
    (microsoft.public.dotnet.security)