Cannot Write Exception to Event Log
From: John Gordon (john.gordon.156699@**no-sp4m**wamu.net)
Date: 04/09/03
- Next message: Tim Clamp: "Re: Access Denied Error"
- Previous message: Dave S.: "Re: Has anyone used DirectoryEntry() against Novell 5 LDAP?"
- In reply to: Al: "Cannot Write Exception to Event Log"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
From: "John Gordon" <john.gordon.156699@**no-sp4m**wamu.net> Date: Wed, 9 Apr 2003 10:24:15 -0700
There is a better way to do this. The dotnet service
needs to have permissions to write to the event log. You
can do this by chaning a setting in the file mentioned
below:
Open Machine.Config (by default in
C:\WINNT\Microsoft.NET\Framework\v1.0.3705\CONFIG) in a
text editor, find the <processModel> section, and set the
userName attribute to "SYSTEM". This is required to
enable event logging in ASP.NET Applications -- which we
use in our custom error handling.
--Excerpt from that most wonderful Wrox book: "ASP.NET
Website Programming", Marco Bellinaso and Kevin Hoffman.
>-----Original Message-----
>I have an ASP.Net form that attempts to write to the
event log on a
>Windows XP Pro machine if an problem occurs. However, I
am getting a
>security exception when the form tries to do that. (See
below). This
>occurs regardless of whether I run form in Visual
Studio.Net or from
>browser. User account on machine is memeber of
administrators. Is
>there some other account running this that needs some
sort of .Net
>code policy or something?
>
>
>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 47: Dim log As New EventLog()
>Line 48: log.Source = "DivisionPage"
>Line 49: log.WriteEntry(err.Message,
>EventLogEntryType.Error)
>Line 50:
>Line 51:
>.
>
- Next message: Tim Clamp: "Re: Access Denied Error"
- Previous message: Dave S.: "Re: Has anyone used DirectoryEntry() against Novell 5 LDAP?"
- In reply to: Al: "Cannot Write Exception to Event Log"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|
|