SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have just a small Question: Can I tell a feature with scope "Web" only to be activated on the RootWeb in Feature.Template.xml?

Something like


I have a listInstance (ConnectionLibrary) and a module with RootWebOnly="TRUE". Sure i can just change the scope to site and remove the RootWebOnly attribute, but i don't want to. I'm just curious if its possible to do that.

share|improve this question
up vote 2 down vote accepted

Set the scope to Scope="Site" and in the code make sure that whatever changes you make always point to SPContext.Current.Site.RootWeb(). If done correctly, it should only affect the rootweb as wanted.

share|improve this answer

I think it's impossible to do that, but it means that you want to do something on the site collection (the root web is the root of the site collection).

share|improve this answer

Logically, I am not sure if this is possible or not. May be we can restrict our code to SPContext.Current.Site.RootWeb() only but still..

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.