共用方式為


What Can Be Implemented in Sandboxed Solutions in SharePoint 2010

This topic summarizes the various kinds of development projects that can be deployed as sandboxed solutions.

Applies to: SharePoint Foundation 2010

Available in SharePoint Online

The topics in this section provide detailed instructions for some of these projects.

Warning

The Sandbox Solution framework provides a mechanism for executing user-provided code outside of the IIS worker process. The Sandbox Solution framework should not be used as a mechanism for enforcing security boundaries when executing user code. Sandbox Solutions are not supported as a security boundary with user code, especially code of unknown origin. We advise against executing Sandbox Solutions of unknown origins.

Note

For information about what cannot be done with a sandboxed solution, see Restrictions on Sandboxed Solutions in SharePoint 2010 and the other topics in that section.

Available Components in Sandboxed Solutions

The following table identifies the most common components that can be included as part of a sandboxed solution.

Component

Remarks

Assembly

Refers to assemblies whose source code is part of the Microsoft Visual Studio sandboxed solution project. Non-SharePoint assemblies cannot be deployed in a sandboxed solution. Assemblies in sandboxed solutions are persisted in the content database inside the solution package (.wsp) file. When called, they are unpacked and temporarily stored in the file system of the front-end web server. For more information, see Where are Assemblies in Sandboxed Solutions Deployed?.

Binding of content type to a list

For more information, see How to: Create and Deploy Common Declarative Elements in Sandboxed Solutions.

Content type

For more information, see How to: Create and Deploy Common Declarative Elements in Sandboxed Solutions.

Custom action for a menu, the ribbon, or an administration page

For more information, see How to: Create and Deploy Common Declarative Elements in Sandboxed Solutions.

Event receiver

This refers to classes derived from SPEventReceiverBase. For more information, see How to: Create and Deploy Event Receivers in Sandboxed Solutions.

See also Feature receiver, later in this table.

Feature

Only Features scoped to the site collection or the website are possible in sandboxed solutions. Farm and web application scope are not possible.

All other components in this table should be deployed in one or more Features.

Feature receiver

For more information, see How to: Create and Deploy Feature Receivers in Sandboxed Solutions.

Field

Only fields that use a built-in SharePoint Foundation field type, or a custom field type that is previously installed in a farm solution, are possible. A custom field type cannot be deployed in a sandboxed solution. For more information, see How to: Create and Deploy Common Declarative Elements in Sandboxed Solutions.

List/library instance

For more information, see How to: Create and Deploy Common Declarative Elements in Sandboxed Solutions.

List/library template

For more information, see How to: Create and Deploy Common Declarative Elements in Sandboxed Solutions.

Master page

For more information, see How to: Create and Deploy Common Declarative Elements in Sandboxed Solutions.

Module (one or more files)

For more information, see How to: Create and Deploy Common Declarative Elements in Sandboxed Solutions.

Property bag

For more information, see How to: Create and Deploy Common Declarative Elements in Sandboxed Solutions.

NoteNote
However, the SPPropertyBag is not available in sandboxed solutions.

Microsoft SharePoint Designer 2010 workflow, also known as a "no code" or "declarative" workflow

Coded workflows cannot be deployed in a sandboxed solution. For more information, see How to: Create and Deploy Declarative Workflows in Sandboxed Solutions.

Site page, including both master page and content page

Application pages cannot be included in a sandboxed solution. For more information, see How to: Create and Deploy Common Declarative Elements in Sandboxed Solutions.

Stapling of a Feature to a site definition configuration (also known as Feature/Site Template Association)

For more information, see How to: Create and Deploy Common Declarative Elements in Sandboxed Solutions.

Web Part

Only Web Parts derived from System.Web.UI.WebControls.WebParts.WebPart can be used in a sandboxed solution. Web Part connections are not possible in sandboxed solutions.

Web template

A web template is deployed as a WebTemplate element along with an onet.xml file and optionally a default.aspx file. A web template is functionally equivalent to a site definition configuration. Site definition configurations cannot be deployed in a sandboxed solution. For more information, see Site Types: WebTemplates and Site Definitions.

Workflow action

For more information, see How to: Create and Deploy Workflow Actions in Sandboxed Solutions.

See Also

Concepts

Sandboxed Solutions Architecture in SharePoint 2010

Restrictions on Sandboxed Solutions in SharePoint 2010

Other Resources

Sandboxed Solutions in SharePoint 2010

Sandboxed Solutions Resource Center | SharePoint 2010

SharePoint Developer Team Blog

SharePoint Developer Center