Requested Registry access is not allowed

From: Brian Rupert (BrianRupert_at_discussions.microsoft.com)
Date: 08/03/04


Date: Tue, 3 Aug 2004 05:47:05 -0700

I'm using .net on an XP webserver, and trying to have my application write to the event log when I get an application error.
Here is the error message I'm getting:

Security Exception
Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.

Exception Details: System.Security.SecurityException: Requested registry access is not allowed.

Source Error:
Line 31: EventLog log = new EventLog ();
Line 32: log.Source = "Odometer Application";
Line 33: log.WriteEntry (msg, EventLogEntryType.Error);
Line 34: }
Line 35: </script>
Source File: c:\inetpub\wwwroot\odometer\webform1.aspx Line: 33
My processModel username is "SYSTEM". I'm using Windows authentication.
Can anyone tell me what I'm doing wrong?



Relevant Pages

  • Cannot Write Exception to Event Log
    ... needs to have permissions to write to the event log. ... >security exception when the form tries to do that. ... >code policy or something? ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Requested Registry access is not allowed
    ... When an event log hive is created, a corresponding registry entry is created ... context your code is running must be able to create this entry. ... > Security Exception ...
    (microsoft.public.dotnet.security)
  • Re: EMAB : security exception while writing to event log
    ... > I am trying to use EMAB with an ASP.NET application. ... > known' security exception when writing to event log. ...
    (microsoft.public.dotnet.distributed_apps)

Quantcast