Curious about SharePoint 2010 sandbox solutions. Started an empty SharePoint project and selected to deploy it as a sandbox solution on the prompt. Created two simple web parts (not visual web parts), and also added a feature event receiver to create a list at root web, then activated the feature. Got through solution built step successfully, but got an error message during deploy - "Error occurred in deployment step 'activate features' the sandboxed code execution request was refused because the sandboxed code host service was still initializing".
Back to MSDN, and found this useful link to help me verify if my sandbox solution is ready in my farm, or not.
To summarize
In your central admin,
- go to your System Settings -> Manage Services On Server, and make sure "Microsoft SharePoint Foundation Sandboxed Code Service" is showed as started. If not, start it.
- go to Manage Applications -> Site Collection -> Configure Quotas and Locks, and scroll down to the bottom to check that your sandbox solution resource quota has a value in field "Limit maximum usage per day to". The default it 300.
If the daily quota is exceeded, the sandbox solution in your farm will stop executing.
After above steps, deployment went through fine.
Below are the things I learned about Sandbox, and are worth of noting down.
- It is only good, if you need this solution to be ran in one site collection. You cannot run it across multiple site collections.
- Sandbox solution runs in its own process - SPUCHostService.exe, SPUWorkerProcess.exe, instead of w3wp.exe.
- For artifacts that require to be deployed to the SP 14 (GAC) folder, sandbox solution usually does not work. However, learned lately that the Visual Web Part (the one that adds ascx file to the GAC) can now be used in Sandbox solution w/ Visual Studio SharePoint Power Tools. For application pages (aspx), they still cannot be used in a sandbox solution.
I also read about using full-trust proxy to allow a sandboxed solution call to a trusted assembly outside the sandbox. Sounds like a work-around here. Overall, not super impressed by this Sandbox feature in SharePoint.