Sandboxed solutions in SharePoint 2010
Check out Best Alternative to InfoPath -> Try Now
A SharePoint sandbox solution is a restricted execution environment that enables programs to access only certain resources, and that keeps problems that occur in the sandbox from affecting the rest of the server environment.
Here in this SharePoint tutorial, we will discuss what is Sandboxed solutions in SharePoint? What you can do with Sandboxed Solutions in SharePoint 2013/2010? And how to deploy a sandboxed solution in SharePoint 2010/2013?
SharePoint 2016 Tutorial Contents
- The sandboxed solution is a new concept comes in SharePoint 2010.
- A sandbox is a restricted execution environment that enables programs to access only certain resources, and that keeps problems that occur in the sandbox from affecting the rest of the server environment.
- A user can deploy a solution package to the SharePoint server farm and also the solution can be deployed to that sandbox.
- To deploy something in the sandbox you do not need any farm level administration privileges.
- Sandboxed solutions can be added to a production SharePoint Server environment without the risk of affecting processes outside the sandbox.
- The components that we can deploy in SharePoint sandbox are web part, Event receivers, feature receivers, customizing Sharepoint designer workflows, List definitions, List instances, Content Types, etc.
- And some of the thing that we can not do in the sandbox are Visual web part.
- To work with Sandbox you need to start the Microsoft SharePoint Foundation User code service. To activate this go to Central Administration -> Services on Server SharePoint 2010 and there activate Microsoft SharePoint Foundation User Code Service.
- If you deploy in Sandbox then you do not need any IIS reset.
You can deploy below things in the Sandboxed environment in SharePoint 2013/2010:
- Deploy a new list definition. Also, you can check How to create a custom list definition using visual studio 2010?
- Deploy a new list definition with list item event receivers.
- Deploy a list definition with list event receivers.
- You can create event receiver classes within sandboxed solutions for events that fire on list items, lists, and individual sites.
- Deploy a site definition. Also, you can check How to create a Site Definition using Visual Studio 2010 in SharePoint 2010?
- We can Create a content type using a sandboxed solution in SharePoint.
- Create a new ribbon element.
- Create a new Site Actions menu item in SharePoint.
- Create an instance of a SharePoint list.
- Programmatically create a SharePoint subsite.
Below, is how you can deploy the sandboxed solution in SharePoint 2010.
Apart from Farm solution, you can also deploy the sandboxed solution using PowerShell command. The only difference is we need to insert User after SP like SPUserSolution. Remember Sandboxed solutions run under the sandboxed worker process which is known as SPUCWorkerProcess.exe.
Below is the full list of command to deploy sandboxed solution in SharePoint.
Open the SharePoint 2010 Management Shell. You can get to this by going to Start > All Programs > Microsoft SharePoint 2010 Products > SharePoint 2010 Management Shell.
Add a Sandboxed Solution to the site:
Add-SPUserSolution -LiteralPath “C:\Bijay\MyTestSandboxSol.wsp” -Site http://URL
Install Sandboxed Solution:
Install-SPUserSolution -Identity MyTestSandboxSol.wsp -Site http://URL
Uninstall Sandboxed Solution:
Uninstall-SPUserSolution -Identity MyTestSandboxSol.wsp -Site http://URL
Remove Sandboxed Solution:
Remove-SPUserSolution -Identity MyTestSandboxSol.wsp -Site http://URL
Update Sandboxed Solution:
Update-SPUserSolution -Identity MyTestSandboxSol.wsp -Site http://URL MyTestSandboxSolUpgrade.wsp
Remember to add the new upgrade solution (MyTestSandboxSolUpgrade.wsp) before upgrade the solution.
Hope this SharePoint 2010 tutorial helps to know the sandboxed solution in SharePoint? What we can do using SharePoint sandboxed solution and how to deploy sandboxed solutions in SharePoint 2010 using PowerShell command.
SharePoint Online FREE Training
JOIN a FREE SharePoint Video Course (3 Part Video Series)