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