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.
If you're looking for a solution regarding a production environment please skip to the end of the text.
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.
Jan suggest the following for this scenario:
"In a production environment you should grant the sandbox service account full control on the web application, which solves the same problem."