Tuesday, July 17, 2012

Sandbox Solutions in SharePoint 2010

This is a new feature in SP2010. We can set this option while creating a new project in VS 2010 SharePoint solutions as Sandboxed solutions or farm solutions.

The main aim of this Sandboxed solution is, deploying custom solutions rapidly without having the administrator permissions and isolates from other site collections which will not affect the entire farm.

Farm Solutions
Farm solutions, which are hosted in the IIS worker process (W3WP.exe), run code that can affect the whole farm. When you debug a SharePoint project whose Sandboxed Solution property is set to "farm solution," the system's IIS application pool recycles before SharePoint retracts or deploys the feature so as to release any files locked by the IIS worker process. Only the IIS application pool serving the SharePoint project's site URL is recycled.

Sandboxed Solutions
Sandboxed solutions, which are hosted in the SharePoint user code solution worker process (SPUCWorkerProcess.exe) or we can call as Untrusted Code, run code that can only affect the site collection of the solution. Because sandboxed solutions do not run in the IIS worker process, neither the IIS application pool nor the IIS server must restart. Visual Studio attaches the debugger to the SPUCWorkerProcess process that the SPUserCodeV4 service in SharePoint automatically triggers and controls. It is not necessary for the SPUCWorkerProcess process to recycle to load the latest version of the solution.

When we create Sandboxed solution it will automatically deployed into Solutions gallery of particular site collection. Here we can activate or deactivate the solutions and we can set the resources limit on this site collation by using quota template options.

Another important point is, Sandboxed solutions do not allow accessing the full object model.In this solutions we can access only sub set of full object model, if we access the full object model that is suppose for example if we try to access the SPFarm object it will give an exception. And it will not deploy the solution or not allow to create a package if we try to deploy anything layout folders.

For Sandboxed solutions, Visual Studio intellisence shows only the allowed SharePoint objects.

No comments:

Post a Comment