To Sandbox or not to sandbox?

June 3, 2011

Custom Development

Microsoft SharePoint (Foundation) 2010 introduced the concept of running sandboxed code. This code can be deployed using WSP solutions, but the difference is it can be uploaded by authorized users at the Site Collection. Sandbox solutions run in a limited SharePoint Execution context and farm administrators can monitor and manage those solutions.

Because of the limited context, only a subset of the SharePoint Server Object Model is available. To quickly figure out, if a Sandboxed solution is possible (or even required), I created a small chart. The chart and information is not even close to complete and I will probably update these regularly.

For extensive information about the Sandbox in SharePoint 2010: http://msdn.microsoft.com/en-us/magazine/ee335711.aspx

Oh, one more thing: Microsoft recommends Sandbox Solutions by default. So only use those Farm solutions if you really need to.

SharePoint 2010 design chart

The following Microsoft.SharePoint subset can be used with sandboxed solutions:

Namespace    Remark
Microsoft.SharePoint All, except SPSite constructor, SPSecurity, SPWorkItem and SPWorkItemCollection, SPAlertCollection.Add, SPAlertTemplateCollection.Add, SPUserSolution and SPUserSolutionCollection, SPTransformUtilities
Microsoft.SharePoint.Navigation     
Microsoft.SharePoint.Utilities SPUtility.SendEmail, SPUtility.GetNTFullNameandEmailFromLogin
Microsoft.SharePoint.Workflow SPWebPartManager, SPWebPartConnection, WebPartZone, WebPartPage, ToolPane, ToolPart
Microsoft.SharePoint.WebPartPages  

The following items can not be deployed using a sandboxed solution:

  • Site Definition
  • Application Pages
  • Farm and Web Application scoped features
  • Custom Actions Group
  • Custom Fields
  • Visual Studio Visual Web Part
  • Workflows with code
  • HideCustomAction
  • SharePoint Timer Jobs
  • Feature Receivers for Farm and Web scoped features
, , ,

4 Comments on “To Sandbox or not to sandbox?”

  1. SharePoint Consulting Says:

    Nice chart. We have been using sand boxed solutions based on specific client requirements and environment factors.

    Reply

  2. Vinicius Pavan Ribeiro Says:

    Increbible chart!!! It answers a lot!!!

    Reply

Trackbacks/Pingbacks

  1. “Code-easy” modifications for SharePoint 2010: Part 1, the Validating Email Field | All Things SharePoint - June 4, 2011

    [...] All Things SharePoint Just another WordPress.com site Skip to content HomeAboutFriend List ← WCF Service Factory in SharePoint 2010 To Sandbox or not to sandbox? → [...]

  2. Speed up SharePoint 2010 development | All Things SharePoint - July 19, 2011

    [...] Remember: farm solutions require a IIS recycle where as sandbox solutions do not (see earlier post about Sandbox solutions). You can always merge them later when heading towards production [...]

Leave a Comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 80 other followers