Resolution: security exception. The request type permission has failed.

Source: Internet
Author: User
Tags mscorlib

Security Exception
Note: An application attempts to perform operations that are not permitted by a security policy. To grant the required permissions to the application, contact the system administrator or change the trust level of the application in the configuration file.

Exception details: System. Security. SecurityException: the request for "System. Security. Permissions. SecurityPermission, mscorlib, Version = 2.0.0.0, Culture = neutral, PublicKeyToken = b77a5c561934e089" type permission has failed.

Source error:

An unhandled exception is generated during the execution of the current Web request. You can use the following exception stack trace information to determine the cause and location of the exception.

Stack trace:


[SecurityException: the request for "System. Security. Permissions. SecurityPermission, mscorlib, Version = 2.0.0.0, Culture = neutral, PublicKeyToken = b77a5c561934e089" type permission has failed.]
System. Web. UI. PageParser. GetCompiledPageInstance (String virtualPath, String inputFile, HttpContext context) + 27
URLRewriter. RewriterFactoryHandler. GetHandler (HttpContext context, String requestType, String url, String pathTranslated) in D: \ company project \ documentation \ Linyi \ Users \ URLRewriter \ RewriterFactoryHandler. cs: 71
System. Web. HttpApplication. MapHttpHandler (HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig) + 175
System. Web. MapHandlerExecutionStep. System. Web. HttpApplication. IExecutionStep. Execute () + 120
System. Web. HttpApplication. ExecuteStep (IExecutionStep step, Boolean & completedSynchronously) + 155

 

The reason is that I set the cmd permission to restrict the running of net.

1 <securityPolicy>
2 <trustLevel name = "Full" policyFile = "internal"/>
3 <trustLevel name = "High" policyFile = "web_hightrust.config"/>
4 <trustLevel name = "Medium" policyFile = "web_mediumtrust.config"/>
5 <trustLevel name = "Low" policyFile = "web_lowtrust.config"/>
6 <trustLevel name = "Minimal" policyFile = "web_minimaltrust.config"/>
7 </securityPolicy>
8 <trust level = "Full" originUrl>

For more information, see tools. Then, the above problem occurs when you create a new site. The solution is as follows:

Find web. config in the web directory

</System. web>

 

Add

<Location allowOverride = "true">
<System. web>
<Trust level = "Full"/>
</System. web>
</Location>

You can,

From: f4le.com

Related Article

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.