Monday, October 29, 2012

Request for the permission of type 'Microsoft.SharePoint.Security.SharePointPermission, Microsoft.SharePoint.Security, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' failed



This is the one of the strange errors when working with sharepoint.

Cause for he error :

This is because sharepoint by default is provided with the minimal trust permission level.

For some operations we need trust from the security policy.

Solution :

This requires change in the Trust Level in Web.Config file of the Web app.

Go to web.config file of the web application usually this will be located in

C:\inetpub\wwwroot\wss\VirtualDirectories\[Web application directory]

and open the web.config and change the

trust level="WSS_Minimal" to trust level="WSS_Medium"

or

trust level="WSS_Minimal" to trust level="Full"

Happy coding !!


3 comments:

  1. "Sharepoint development "
    A very informative item. Hold posting such kind of information on your blog.
    Web Solution

    ReplyDelete
  2. Thanks a lot bro, this solve my issue after scratching my hair a whole day...

    ReplyDelete
  3. Thanks alot, exactly what I was looking for. Also you can do RunwithelevatedPriveleges in codebehind for bypassing this security issue.

    ReplyDelete