System.Security.SecurityException:System.Web.AspNetHostingPermission

Source: Internet
Author: User

The deployment of a Web site today, under Net 4.0 is normal, but under 2.0 found an error: System.Security.SecurityException, the error message is as follows:

Security exception
Description: An application attempted to perform an operation that was not allowed by the security policy. To grant the required permissions for this application, contact your system administrator, or change the trust level of the application in the configuration file.

Exception Details: System.Security.SecurityException: Request "System.Web.AspNetHostingPermission, System, version=2.0.0.0, culture= Neutral, publickeytoken=b77a5c561934e089 "type of permission has failed.

SOURCE Error:

An unhandled exception was generated during the execution of the current WEB request. You can use the following exception stack trace information to determine information about the cause of the exception and where it occurred.

At first, I thought it was a permissions issue, giving the network to C:\WINDOWS\temp and C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP. SERVICE, ASPNET Modify permissions, no results, or the same error.

Finally, the following methods are resolved:

The Web. config configuration is as follows:

<authorization>
<allow users= "*"/>
</authorization>
<identity impersonate= "true" Username= "Nuc" password= ""/>
Username= "Nuc" password= "" is the operating system login name and password

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.