This topic has not yet been rated - Rate this topic

SPFeatureDefinition.Scope Property

Gets the scope of this Feature.

Namespace:  Microsoft.SharePoint.Administration
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online
public SPFeatureScope Scope { get; }

Property Value

Type: Microsoft.SharePoint.SPFeatureScope
An SPFeatureScope value that specifies server farm, Web application, site collection, or Web site as the scope.
Exception Condition
ArgumentException

Property is null.

While a Web site Feature is scoped at the individual Web site level, a site collection Feature contains items that apply to the site collection as a whole (for example, content types that are shared across the site collection), as well as items that can be activated per site. Elements that can have either site collection or site scope include list definitions (templates and instances), modules (file sets), and item content type behaviors (per-item custom menu options and per-item events).

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
Not to be confused with the SPFeatureDefinitionScope enum
...which is used to differentiate Farm vs. Sandboxed feature definitions when activating a feature at the Site or Web level.

SPFeatureCollection.Add:
http://msdn.microsoft.com/en-us/library/ee549179(office.14).aspx

SPFeatureDefinition:
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spfeaturedefinitionscope(office.14).aspx