Search This Blog

Thursday, November 21, 2013 request for the permission of type ', mscorlib, version=, culture=neutral, publickeytoken=b77a5c561934e089' failed


You might get following error “System.Security.SecurityException: Request for the permission of type ‘System.Security.Permissions.EnvironmentPermission, mscorlib, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089′ failed.
specially when you have web application configured under Share point Virtual Directoryand you try to access web service or write a log file or try to call method from custom assembly.
The reason you get this error is your web application runs under WSS_Minimal trust.
In IIS, Select your sharepoint virtual directory and go to Features view.
In features view select .NET Trust Levels.
In .NET Trust Level you will see default WSS_Minimal trust. Change it to Full Trust and re-start web application.

No comments:

Post a Comment