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.