While developing a Sandboxed solution in SharePoint 2010 using the Visual Studio 2010 SharePoint developer tools it happened that I wasn’t able to deploy the solution using F5.
The error message wasn’t exact on how to solve the problem:
Error occurred in deployment step 'Add Solution': Unable to load assembly group. The user assembly group provider threw an exception while trying to provide user assemblies for the specified assembly group.
The detailed information about the error is the following:
Unable to load assembly group. The user assembly group provider threw an
exception while trying to provide user assemblies for the specified assembly group.
- Assembly group id: ", GroupId = "<SOME_ID>""
- Inner Exception: System.UnauthorizedAccessException: Access is denied.
(Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
at Microsoft.SharePoint.SPWeb.GetCatalog(SPListTemplateType typeCatalog)
While doing a search I found a suggestion to change the account for the ‘SharePoint 2010 User Code Host’.
The developer image was set up by a colleague who didn’t use the farm account as the domain account for the SharePoint 2010 User Code Host service.
Here you can see the service... while trying to debug I realized that the given account on the right side was not the one I expected.
So I used the services under administrative tools and changed the domain account to the SharePoint 2010 farm account:
Changing the account solved my problem:
At the end I was able to deploy the Sandboxed solution.