Whenever I try to debug (i.e. F5) a SharePoint 2010 Project I get this error. All the SharePoint services are running. Messages in Output window:

Add solution
  Adding solution 'my solution.wsp'...
  Deploying solution 'my solution.wsp'...
Error occurred in deployment step 'Add Solution': Sandboxed code execution request failed.

I press 'Yes' to continue, then go to the solution and activate. After activating I then get another error:

Could not load file or assembly 'Microsoft.SharePoint.Publishing, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The system cannot find the file specified.

Running on SharePoint Foundation 2010. Can't do anything with the site after this so have to delete the site collection and add it again.

  • I'm having the same problem but this used to work. What I'm wondering is if this is related to my installing AVG Anti-Virus. I did though uninstall the AVG Anit-Virus and still have the same problem.
    – user3715
    Commented Jun 12, 2011 at 15:14

2 Answers 2


The Microsoft.SharePoint.Publishing.dll does not work in the sandbox. I think that's the reason why you are getting the second error.

See this post for more details: http://www.elumenotion.com/Blog/Lists/Posts/Post.aspx?ID=124


please read this article you may find the solution.



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.