ASP.NET App Writing to Event Log on Server

Tech-Archive recommends: Fix windows errors by optimizing your registry



We are developing an ASP.NET 2.0 (C#) application, and I'm having troubles
getting the ASP.NET app. to write to the event log when accessing the web
site from a separate client computer.

Here's some details:

Server and client computers both in the same workgroup
Logged into server as local Administrator
Logged into client as a local user that is only in the Users group on the
client computer
The local user on the client is also defined as a local user on the server
with same name and password (and only in the Users group on the server too)
Server is Windows Server 2003 running IIS 6.0
Client is Windows XP Professional
ASP.NET 2.0 (C#) web site - intranet only, not a public Internet web site


Web.config snippet
<system.web>
<authentication mode="Windows"/>
<identity impersonate="true"/>
</system.web>



..aspx code-behind code snippet
string exceptionInfo = "Testing WriteToEventLog";
System.Diagnostics.EventLog log = new System.Diagnostics.EventLog();
log.Log = "Application";
log.Source = "Application";

try
{
// EXCEPTION happens here
log.WriteEntry(exceptionInfo,
System.Diagnostics.EventLogEntryType.Error);
}
finally
{
log.Close();
log.Dispose();
}


The exception details are: System.ComponentModel.Win32Exception: Access is
denied (Cannot open log for source 'Application'. You may not have write
access.)

From the client computer, I can navigate to the site and do whatever without
any problems. But, when the site tries to write to the event log on the
server for the session started by the client in the scenario described
above, it fails.

Basically, this is supposed to be an exception notification thing.


What's wrong? Am I missing something? How can I make the above scenario
work?


Thanks.



.



Relevant Pages

  • PuTTY suddenly stopped working (WinXPsp2 to FreeBSD5.4)
    ... assumption is that the problem is on the Client machine. ... On the Server ... ... Open a PuTTY session and I am prompted for a username. ... Event Log: Writing new session log to file: ...
    (comp.security.ssh)
  • Re: How to set up DCOM properly to allow server and client connect remotely
    ... their accounts if said accounts have the same username ... I need to know how to set up DCOM properly so the OPC server and client ... local user ...
    (microsoft.public.win32.programmer.ole)
  • Re: ISA Server Headaches
    ... I had not checked the event log for the workstations yet... ... errors in the system log that may be relivant, ... The specified server cannot perform the ... > the eventlogs of the client and the server? ...
    (microsoft.public.windows.server.sbs)
  • Re: ASP.NET App Writing to Event Log on Server
    ... Administrators group on the server). ... Server and client computers both in the same workgroup ... Logged into client as a local user that is only in the Users group on ... The exception details are: System.ComponentModel.Win32Exception: Access ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: TS goes down several times a week
    ... informative entries in the eventlogs that seem to be ... server slowed down. ... his client had ver. ... Does the event log show anything related to drive or device redirection? ...
    (microsoft.public.windows.terminal_services)