Developing SharePoint Sandbox solutions Tutorial Part 2

In Continuation with Developing SharePoint Sandbox solutions Tutorial Part 1, Next lets look at how does Microsoft restrict Sandbox solutions of using various APIs.

Every server on which the SharePoint Foundation Sandboxed Code Service is running, there is a sandboxed worker process in which sandboxed solutions are executed. Calls from code in the sandboxed worker process to the Microsoft.SharePoint.dll are redirected to a special version of that assembly. The special version is in some ways less privileged than other assemblies in the sandboxed worker process.

The most significant restriction is that the special version contains only a subset of the standard assembly’s classes and methods. An exception is thrown when code calls an API that is not included in the special version of the assembly. In addition, even when a method is included in the special version of the assembly, it may impose additional restrictions on the parameters passed to the API. For example, the SPSite(String) and SPSite(Guid) constructors are available to sandboxed solutions, but only URLs or GUIDs that refer to the site collection in which the sandboxed solution is installed can be passed to them. This prevents a sandboxed solution from accessing any websites, lists, or other resources from outside the site collection to which it has been installed.

Now Lets look at what all you can create using Sandbox solutions (MSDN examples)

Create List/Library Template, List/Library Instance, Content Type, Binding of Content Type to List, Custom Action

How to Create and Deploy Event Receivers in Sandboxed Solutions

How to Create and Deploy Feature Receivers in Sandboxed Solutions

How to create and deploy a declarative workflow(created in Microsoft SharePoint Designer)

Create and deploy a custom workflow action

Accessing Current User Information in Sandboxed Solutions

Deploying Sandboxed Content Types and List Definitions

Developing Solution Validators

Developing Web Templates

Developing Sandboxed Web Parts

Related Posts