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.

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, open the shortcut menu for Features, and then choose Add Feature.

  • In Packaging Explorer, open the shortcut menu for the package, and then choose Add Feature.

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 NIB: Building SharePoint Solutions with Team Foundation Server.

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.

PropertyDescription
TitleOptional. The default title of the Feature is set to SolutionNameFeatureName.
DescriptionOptional. The description of the SharePoint Feature.
ScopeRequired. If a Feature is created by using Solution Explorer, the scope is set to Web by default.

- Farm: Activate a Feature for an entire server farm.

- Site: Activate a Feature for all web sites in a site collection.

- Web: Activate a Feature for a specific web site.

- WebApplication: Activate a Feature for all web sites in a web application.
Items in the SolutionAll SharePoint Items that can be added to the Feature.
Items in the FeatureThe SharePoint project items that have been added to the Feature.

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.

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.

How to: Customize a SharePoint Feature
How to: Add and Remove Items to SharePoint Features
How to: Add and Remove Feature Dependencies

Show: