Thursday, December 22, 2011

Sandbox Solutions in SharePoint 2010 – Part 1

Before starting what sandbox solution is, first let us understand what solution mean? If you have worked with MOSS 2007 version then you must be aware of solutions. Solutions can be deployed over a farm. With 2010 version solution can also be deployed in sandbox. Solution may contain web parts, images, pages, event handlers, lists etc.

Sandbox solution is a new concept introduced in SharePoint 2010. Advantage of sandbox solution is this solution actually executes in a restricted zone. It cannot access everything in object model. It cannot access certain resources from SharePoint object model.

This is the advantage because it cannot affect the farm environment. If something goes wrong in the sandbox solution then entire farm does not get affected.

Sandbox solution is always given certain number of resource allocation space and that is monitored by farm administrator. If farm administrator wants, then it can be disabled or even it can also be promoted to be a farm solution as an upgrade.

Other advantage of sandbox solution is it can free farm administrator for deployment stand point. Site collection administrator can deploy and activate the sandbox solution. If the sandbox solution does not contain any assembly, then even a user with full control over a top level site of site collection can also deploy the solution.

Sandbox solution runs in a separate process and that is the reason if something goes wrong in sandbox solution then it does not impact farm. It does not run in w3wc process but runs under SPUCWorkerProcess.

For the hosted SharePoint environment, this can be one of the best ways to deploy and maintain the solutions and sites.

There are many limitations in terms of accessing resources while you program against sandbox solutions in SharePoint. I am listing down some of them. You cannot:

    1)    System.IO, ADO.Net
    2)    Write to disk files
    3)    Oher site collection content
    4)    SPSecurity.RunWithElevatedPrivileges
    5)    Change threading model
    6)    Create visual web part
    7)    Access programmatic workflow
    8)    Timer Job
    9)    Web Application scoped features 

Here are certain items that you can do in sandbox solution environment

   1)    Web Parts (not visual)
   2)    Event receivers
   3)    Feature receivers
   4)    Custom SharePoint Designer Workflow Activity

     There are certain steps that farm administrator has to perform before setting up sandbox solution environment if entire set up is farm architecture. Farm administrator starts the sandbox service in each server in farm, configures the best load balancing service for sandbox solutions on each server and then set the resource quotas.

Read Part-2 for further reading.

No comments:

Share your SharePoint Experiences with us...
As good as the SharePointKings is, we want to make it even better. One of our most valuable sources of input for our Blog Posts comes from ever enthusiastic Visitors/Readers. We welcome every Visitor/Reader to contribute their experiences with SharePoint. It may be in the form of a code stub, snippet, any tips and trick or any crazy thing you have tried with SharePoint.
Send your Articles to with your Profile Summary. We will Post them. The idea is to act as a bridge between you Readers!!!

If anyone would like to have their advertisement posted on this blog, please send us the requirement details to