Sharepoint Forum

 
Home » Forum » Sharepoint       Ask a questionRSS Feeds

SPS v2 Object Model Permission problem

  Asked By: Kody Luna         Date: Jan 09, 2010      Category: Sharepoint      Views: 185
 

I have build a webpart and imported it into SPS v2, and it works
just fine.

But when I try to use the SPS ObjectModel, I get this error:

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

Here's a sample of my code:

using Microsoft.SharePoint;
...
SPWeb web = SPControl.GetContextWeb(Context);
SPList list = web.Lists[0]; //The exception is thrown here
output.Write("List name : "+list.Title);

What is the problem?


Do you know someone who can help? Share a link to this thread on twitter, or facebook.

Tagged:            

 

No Answers Found. Be the First, To Post Answer.

 
Didn't find what you were looking for? Find more on SPS v2 Object Model Permission problem Or get search suggestion and latest updates.


Your Answer
  • Answer should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].