Access to registery

A

A.M

Hi,
When i call :

System.Diagnostics.EventLog.WriteEntry(string);

ASP.NET says :

System.Security.SecurityException: Requested registry access is not allowed.

What kind of permission should i give to ASPNET user?

Thanks,
Ali
 
S

Steven Cheng[MSFT]

Hi Ali,

Thank you for using MSDN Newsgroup! My name is Steven, and I'll be
assisting you on this issue.
From your description, you encountered the
"System.Security.SecurityException: Requested registry access is not
allowed."
exception when try to add eventlog via
"System.Diagnostics.EventLog.WriteEntry(string);" in ASP.NET application.
If there is anything I misunderstood, please feel free to let me know.

Based on my research, this seem to be a common issue which is due to :
By default, the user token of the ASP.NET worker process is ASPNET (or
NetworkService for applications that run on Internet Information Services
[IIS] 6.0). The problem in the "Symptoms" section occurs because your
account does not have the correct user rights to create an event source.

Also, there is a KB article which has provided the solution on this issue,
you may check it out to see whether it helps:
#PRB: "Requested Registry Access Is Not Allowed" Error Message When ASP.NET
Application Tries to Write New EventSource in the EventLog

http://support.microsoft.com/?id=329291

If you have need any further assistance, please feel free to let me know.


Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,563
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top