Freigeben über


Hidden features and dependencies

Have you tried to enable some of SharePoint hidden features to play around with them? That might lead to some unexpected results and is not recommended approach to develop new solutions. This is because of the feature activation/deactivation dependencies.

A feature activation dependency is a way of expression a requirement of a relationship between two features.

In WSSv3, activation dependencies can be used to accomplish two things:

  • feature grouping concepts.   When my feature is turned on, turn on these other x number of features.  Ie. the "team collaboration" feature in WSS uses activation dependencies to essentially turn on other features when you turn on team collab.
  • feature resource guarantees.   A lot of times you need an SPSite feature to contain resources (e.g., a content type), and and SPWeb feature to contain an implementation.

Feature Activation Dependencies in the Same Scope

  • If a feature is dependent on another feature at the same scope, and that feature is not on, it will be turned on.
  • If a feature is turned off, turn off any dependent hidden features according to a "last one turns out the lights rule."

Feature Activation Dependencies Across Scopes

  • Feature activation dependencies are not supported across scopes if the dependent feature is not visible (i.e., you can't have a web scoped feature dependent on a site scoped feature that the admin can't see in the site feature UI.)
  • If the dependent feature is not activated, activation of the dependee feature will fail.

General Restrictions:

  • You can't have a dependency from a 'higher' scope to a 'lesser' scope
  • Dependencies can only work one level deep. 
  • Hidden features are frequently used as dependent features, but cannot themselves have dependencies.