Archive

Archive for October, 2008

ActivationDependencies – Feature Scope

October 13, 2008 Leave a comment

    This weekend I got in to an Issue while helping a friend of mine. Some back ground about the issue.

    We have three features. Say for example.

  • FieldsX Scoped at Site.
  • ContentTypeX Scoped at Site.
  • ListX Scoped at Web.

ListX has its Dependency as ContentTypeX; ContentTypeX has its dependency as FieldsX.

I installed all the features, and when I try to activate the ListX feature I get an Error

           “Dependency feature ‘ContentTypeX‘ (id:GUID of ContentTypeX) for feature ‘ListX‘ (id:Guid of ListX) is not activated at this scope.”

    I changed ListX Scope to Site and activated the Feature, thinking that ActivationDependencies should be  between Features of Same scope, though it worked but that is not the case, because we can have Cross Scoped Dependencies as well provided we follow the rule of thumb mentioned in this Article.

“Extract from the Above Article…If the Feature that is depended upon is not activated, activation of the depending Feature fails. For example,if a Web site–scoped Feature depends on a site collection–scoped Feature that is not activated, provisioning of the Web site Feature (or of a site definition that contains such a Web site Feature) fails.

Advertisements