The application attempts to perform operations not permitted by the 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.

Source: Internet
Author: User
Tags mscorlib

This problem occurs when running a website today.

Note:ApplicationProgramAttempts to perform operations not permitted by the 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. reflectionpermission, mscorlib, version = 2.0.0.0, culture = neutral, publickeytoken = b77a5c561934e089" 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. reflectionpermission, mscorlib, version = 2.0.0.0, culture = neutral, publickeytoken = b77a5c561934e089" type permission has failed.] System. security. codeaccesssecurityengine. throwsecurityexception (Assembly ASM, permissionset granted, permissionset refused, runtimemethodhandle rmh, securityaction action, object demand, ipermission permthatfailed) + 150 system. security. codeaccesssecurityengine. throwsecurityexception (Object assemblyorstring, permissionset granted, permissionset refused, runtimemethodhandle rmh, securityaction action, object demand, ipermission permthatfailed) + 100 system. security. codeaccesssecurityengine. checksethelper (permissionset grants, permissionset refused, permissionset demands, runtimemethodhandle rmh, object assemblyorstring, securityaction action, Boolean throwexception) + 284 system. security. permissionsettriple. checksetdemand (permissionset demandset, permissionset & altereddemandset, runtimemethodhandle rmh) + 69 system. security. permissionlistset. checksetdemand (permissionset pset, runtimemethodhandle rmh) + 150 system. security. permissionlistset. demandflagsorgrantset (int32 flags, permissionset grantset) + 30 system. threading. compressedstack. demandflagsorgrantset (int32 flags, permissionset grantset) + 40 system. security. codeaccesssecurityengine. reflectiontargetdemandhelper (int32 permission, permissionset targetgrant, compressedstack securitycontext) + 123 system. security. codeaccesssecurityengine. reflectiontargetdemandhelper (int32 permission, permissionset targetgrant) + 54

In web. config

<Trust level = "full"/>

Change the trust level to full.

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.