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=18.104.22.168, 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.