SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
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 Jun 12 '11 at 15:14
up vote 2 down vote accepted

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:

share|improve this answer

please read this article you may find the solution.

share|improve this answer
While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. – Hugh Wood Dec 10 '12 at 10:42

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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