Write to EventLog from asp.net

Write to EventLog from asp.net

Post by Anders Bot » Thu, 08 Jan 2004 07:02:18


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.
 
 
 

Write to EventLog from asp.net

Post by Kevin Spen » Thu, 08 Jan 2004 07:29:18

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.

 
 
 

Write to EventLog from asp.net

Post by Anders Bot » Thu, 08 Jan 2004 10:31:33


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.

http://www.yqcomputer.com/ %3Ben-us%3B329291





allowed
permission
trust
 
 
 

Write to EventLog from asp.net

Post by Kevin Spen » Thu, 08 Jan 2004 22:58:09

> Yes but how do you do that in an easy way.

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.





have
permission


registry