Поделиться через


Creating SharePoint Features

You can use a SharePoint Feature to group related SharePoint project items for easier deployment. You can create Features, set scopes, and mark other Features as dependencies by using the SharePoint Feature Designer. The designer also generates a manifest, an XML file that describes each Feature.

Adding Features to the SharePoint Solution

You can add a Feature to the SharePoint solution by using Solution Explorer or the Packaging Explorer. You can use one of the following methods to add a Feature.

  • In Solution Explorer, right-click Features and then click Add Feature.

  • In Packaging Explorer, right-click the package, and then click Add Feature.

Using the Feature Designer

A SharePoint solution can contain one or more SharePoint Features, which are grouped under the Feature node in Solution Explorer. Each Feature has its own Feature Designer that you can use to customize the Feature properties. For more information, see How to: Customize a SharePoint Feature.

To distinguish Features from one another, you can configure the Feature properties such as the title, description, version, and scope. For more information, see How to: Modify Feature Properties.

Feature Designer Options

After you create a Feature, you can use the Feature Designer to customize it.

The following table describes the Feature properties that are displayed in the Feature Designer.

Property

Description

Title

Optional. The default title of the Feature is set to SolutionName FeatureName.

Description

Optional. The description of the SharePoint Feature.

Scope

Required. If a Feature is created by using Solution Explorer, the scope is set to Web by default.

OptionDescription
FarmActivate a Feature for an entire server farm.
SiteActivate a Feature for all Web sites in a site collection.
WebActivate a Feature for a specific Web site.
WebApplicationActivate a Feature for all Web sites in a Web application.

Items in the Solution

All SharePoint Items that can be added to the Feature.

Items in the Feature

The SharePoint project items that have been added to the Feature.

Adding and Removing SharePoint Project Items

You can select which SharePoint project items that you want to add a SharePoint Feature to for deployment. Use the Feature Designer to add and remove items to Features, and view the Feature manifest. For more information, see How to: Add and Remove Items to SharePoint Features.

Adding Feature Dependencies

You can configure the Feature manifest so that the SharePoint server activates certain Features before your Feature is activated. For example, if your SharePoint Feature depends on other Features for functionality or data, the SharePoint server can first try to activate any of the Features that your feature depends on. For more information, see How to: Add and Remove Feature Dependencies.

See Also

Tasks

How to: Customize a SharePoint Feature

How to: Add and Remove Items to SharePoint Features

How to: Add and Remove Feature Dependencies