What are Sandbox Solutions in SharePoint?

The solutions that are developed for SharePoint can be directly deployed to the farm, but there runs a risk that incase there is any malicious code then the whole farm might be affected. In order to avert any such situation the concept of Sandbox has been developed.

Sandbox is a restricted area within the farm, with access to minimal resources, where the users can test their solutions without affecting the running of the farm. The solutions that are being deployed to the sandbox is known as Sandbox Solutions and can only access data from within the site collection where it has been deployed. Since Sandboxed solutions cannot affect the whole server farm, they do not have to be deployed by a farm administrator. Sandboxed solutions can be deployed by a site collection administrator or, in certain situations, by a user who has the Full Control permission level at the root of the site collection. However, only a farm administrator can configure Sandboxed solutions–related settings such as load balancing, tiers, quotas and resource points and only a farm administrator can promote a Sandboxed solution to run directly on the farm, outside the Sandboxed environment.

One major difference in the deployment is Farm solutions are installed and deployed. Sandboxed solutions are uploaded and activated.

The processes that are being used are as follows:
  • SPUCWorkerprocess.exe - responsible for the execution of the sandbox code
  • SPUCWorkerProcessProxy.exe - handles the calls to the SP objects
  • SPUCHostService.exe
The benefits are as follows:
  • Sandbox solutions can be added to the production environment without affecting the other processes running within the farm.
  • The sandbox solutions can be deployed by the site collection administrator thus freeing up the farm administrator.
  • Scalability and flexibility are increased because sandboxes run in a separate process that can be restricted by quotas, and their effect on the farm can be monitored.
  • A solution does not have to be modified or recompiled if it is moved from a sandbox to running directly on the farm.
The limitations that are there are as follows:
  • No Security Elevation - the code RunWithElevatedPriviledges are not allowed, no access to the SPSecurity namespace.
  • No Email Support - no access the SPUtility.SenMail class, one has to use the SMTP class to send out the mails.
  • No support/access to the Microsoft.SharePoint.WebPartPages namespace.
  • No support for external web services to ensure security.
  • No GAC deployment - the solutions are not stored in the physcial file path that is the 14 hive nor does it have access to the GAC. Sandbox soltuions can be found in C:\ProgramData\Microsoft\SharePoint\UCCache at runtime.
  • No Visual Web Parts are allowed in sandbox solutions only web parts, event receivers, designer workflows, feature receivers and infopath business logic is allowed.

Comments

Popular posts from this blog

jQuery Basics

What is the difference between a Page Layout and Master Page in SharePoint?

Accessing data from SharePoint 2010 to an ASP.NET application