0

I have created a new feature in visual studio and scoped it to web. I have deployed this to a site collection. When i look at the site collections features it appears there.

Why is this?

I thought this would only appear in subsites of that site collection (because the scope is set to web).

user1786107
  • 783
  • 4
  • 12
  • 33

2 Answers2

4

Take a read of this first off: Previous stack exchange answer

Web targets the site, site targets the site collection etc etc.

So web is only available on the site you point it at, be it the site collection or a sub-site and only in that location. A site collection is just a special sort of site.

  • Web: At the target site/site collection only
  • Site: At the entire site collection and sub-sites
  • WebApplication: At all Site Collections and sub-sites in target WebApp
  • Farm: At all WebApplications, Site Collections and sub-sites

So if you want to target just sub-sites you need to create a deployment script that just loops through each sub-site and deploys at web level.

Hugh Wood
  • 6,285
  • 1
  • 26
  • 45
2

I think you are misundestanding the difference between the Site collection and the root web.

The Site collection is the technical "tree" of SPWebs. At the root, there is also a SPWeb at root.

You will see your features at :

  • http://server/site/siteCollection/_layouts/ManageFeatures.aspx for Web scoped features
  • http://server/site/siteCollection/_layouts/ManageFeatures.aspx?Scope=Site for Site scoped features

This image (from a previous version of SharePoint, but it's still valid) may help you to understand the concepts :

enter image description here

Steve B
  • 7,488
  • 8
  • 53
  • 107