Security Exception: do not allow the requested Registry Access EventLog

Source: Internet
Author: User

Symptom
When ASP. NET is used to create a new event source in the event log, you may receive the following error message:
System. Security. securityexception: Requested registry access is not allowed.

Cause
By default, the User Token of the ASP. NET workflow is ASPnet (or, for applications running on Internet Information Service [IIS] 6.0ProgramIs NetworkService ). Because your account does not have the correct user permission to create an event source, problems may occur in the "symptoms" section.

Temporary emergency measures:
There is a magic solution: houxy finds the "click out and select again in the anonymous access selection box of the IIS virtual directory" method:
First, do not enable Anonymous Access to the virtual directory of the site, so that you can access your web application as the local administrator, because your current identity should have permissions on the registry, so we can certainly do what the Enterprise Library wants to do. Then, enable Anonymous Access to the virtual directory and access the Web application again. Everything becomes normal and "system. Security. securityexception: Registry access requested is not allowed ." .
You can also change the anonymous account in "IIS virtual directory anonymous access" to an account with this permission. For example, the Administrator changes iusr_pyt to administrator.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.