Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
SharePoint Feature

SharePoint Feature

SharePoint 2007

Represents a modular server-side, file system-level customization that contains items that can be installed and activated in a SharePoint environment.

Real World Example

A developer has previous experience creating a custom list structure in earlier versions of SharePoint Products and Technologies that required modifying the onet.xml file. To allow this custom list to exist in Microsoft Office SharePoint Server 2007 and Windows SharePoint Services 3.0 in a way that can be deployed to any existing or new site, she decides to create the list as a Feature that is installed on the server.

Technical Details

Features are composed of at least one feature.xml file that is located in a custom subdirectory of the features directory. Features can also contain other files that make up its components, such as and most commonly an XML file that contains a list of Feature elements.

Each Feature element can be included in a Feature that has the appropriate scope. The Feature scope is defined in the feature.xml definition file and can be one of the elements described in the following table.

Scope Elements

Web (Web site)

Control

Custom Action

Custom Action Group

Hide Custom Action

List Instance

List Template

Module

Receiver

Site (site collection)

Content Type

Content Type Binding

Control

Custom Action

Custom Action Group

Feature/Site Template Association

Field

Hide Custom Action

List Instance

Module

Workflow

WebApplication (Web application)

Control

Custom Action

Custom Action Group

Document Converter

Feature/Site Template Association

Hide Custom Action

Farm (farm)

Control

Custom Action

Custom Action Group

Feature/Site Template Association

Hide Custom Action

Each feature element XML item contains the appropriate data needed to provision that feature element.

Features can have dependencies on other Features, and these other Features can be activated when the Feature that depends on them is activated. Whether these other Features are activated depends on whether they are hidden and whether they are at the same scope. The complete list of rules regarding Feature activation and deactivation can be found in the Windows SharePoint Services 3.0 SDK. If a Feature is dependent on another Feature that is later deactivated, the dependent feature can fail to operate correctly.

Support Details

You must install Features in a custom subdirectory of the features directory. Features might also require that you install certain assemblies. Each Feature GUID must be unique in the server farm or you can encounter issues in resolving the GUID to the correct Feature.

You can remove a Feature from a farm, but if it is not removed from the various locations it was activated against before it is removed, you can experience problems disassociating those Features after removal. Features can leave remnants after removal such as orphaned properties in a property bag, or files that were copied into a Web site upon activation. Whether you decide to leave those remnants depends on the design of the Feature, as it can be desirable to recover those properties if the Feature is re-added, and it can be a poor design choice to remove files that were added if they are relied upon elsewhere. A Feature that adds a file that replaces a customizable file can also permanently remove the capability to remove the customization and return the file back to its original state after the Feature is removed.

As mentioned above, deactivating a Feature that depends on another Feature that is hidden will also deactivate that other Feature if no other Features are dependent on it.

Community Additions

ADD
Show:
© 2015 Microsoft