Write to EventLog from asp.net

  • Thread starter Thread starter Anders Both
  • Start date Start date
A

Anders Both

How can I write to System.Diagnostics.EventLog from within the asp.net
process.

When I try to do it, I get the Message Below

Best Regards Anders Both

ErrorMessage:

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.
 
It means that the account under which you're running ASP.Net doesn't have
permission to access the Event Log for writing. You have 2 choices:

1. Change the account under which ASP.Net runs to one that has permission
2. Grant permission to the ASP.Net acocunt that you are currently using

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
Yes but how do you do that in an easy way.
Is it nessesary to takes all the steps in this artickle. It sound a little
complicated i think.

Well, by the time you read this replay it will have been about 14 hours
since you asked it. Do you think following the steps in that article would
have taken you 14 hours?

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
Back
Top