Re: Security Error when trying to create an Event log
From: Curtis Tammany (tammanyc@egginc.com)
Date: 11/01/02
- Next message: Karl Westerholm [MS]: "RE: Certificate Server API"
- Previous message: Curtis Tammany: "Help: Security Error when trying to create an Event log"
- In reply to: Curtis Tammany: "Help: Security Error when trying to create an Event log"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
From: "Curtis Tammany" <tammanyc@egginc.com> Date: Fri, 1 Nov 2002 16:16:33 -0500
I solved my problem- I added <identity impersonate="true"/> to the <system.web> section the web.config file.
I'm not sure why it works now, but it does.
Curtis
"Curtis Tammany" <tammanyc@egginc.com> wrote in message news:OS$e80dgCHA.2308@tkmsftngp12...
Hello and Help!
I'm trying to create and write to an event log:
Sub Page_Error(sender As Object, exc As EventArgs)
dim errorMessage as string
errorMessage = "Error occurred" & Server.GetLastError().ToString()
Server.ClearError()
Dim LogName As String = "MyApplicationLog"
Dim SourceName As String = "MyApplicationSource"
If (Not EventLog.SourceExists(SourceName))
EventLog.CreateEventSource(SourceName, LogName)
End If
'Insert into Event Log
Dim MyLog As New EventLog
MyLog.Source = LogName
MyLog.WriteEntry(errorMessage, EventLogEntryType.Error)
End Sub
When this sub is called, I get the error:
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.
I've added <trust level="Full" /> to the <system.web> section of my web.config file but I get the same error. What else do I need to do ????
Thanks!
Curtis
- Next message: Karl Westerholm [MS]: "RE: Certificate Server API"
- Previous message: Curtis Tammany: "Help: Security Error when trying to create an Event log"
- In reply to: Curtis Tammany: "Help: Security Error when trying to create an Event log"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|
|