Logger.Write(logEntry) operation not allowed by the security policy

Topics: Logging Application Block
Jul 18, 2007 at 5:55 PM
Hello, I am a new user of the logging block and am attempting to write a log entry ...
Unfortunately, my code raises a security exception when executing the Logger.Write(logEntry) statement.

The exception raised is:
"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. "

I've looked in my config files and they have the default settings for trust ....

What can I do to get logging permissions set? More specifically what config settings do I need?

Thanks.

Douglas Birch
Jul 18, 2007 at 6:28 PM
Here a the additional details:

SecurityException: The source was not found, but some or all event logs could not be searched. Inaccessible logs: Security.
Jul 18, 2007 at 6:46 PM
Edited Aug 1, 2007 at 4:04 PM
Solution Found:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=324053&SiteID=1

My ASPNET user did not have registry level authority to act as an event source for the event logs.

The area of the registry requiring permissions to be set for my ASPNET user is:

My Computer > HKEYLOCALMACHINE\System\CurrentControlSet\Services\EventLog

.... btw, I was running things on my local machine and launching my app from within VS.
Aug 1, 2007 at 4:02 PM
Edited Aug 1, 2007 at 4:02 PM
Btw, this problem also manifests itself as a 4010 unhandled security exception .....