Feature not automatically activating in some site collections
Posted on 2013-02-05
I am working on a dev site with no data, it's strictly for design purposes. I have a wsp that contains a feature scoped at "web". The feature contains a list instance. so whenever I deactivate and then try to reactivate, even via code, I run into an error because that list name already exists. I have three site collections, one at the root and two in /sites. My debug env is set to the root url. So to cure this problem, I have added a deletion and creation of each of these three sites in my predeployment so that activation can work. I also am using the default activation settings which pretty much checks for everything and more specifically, activates the features. This only works for the root level site, and the other two sites show the feature fine, but they are not being automatically activated like the root site feature instance was. When i manually activate these two feature instances, it works fine.
My understanding is that when you scope a solution and it's features to "web", which I have done it does the same thing for all webs on all site collections. So theoretically, I should expect to see that the feature was activated at the site features level (not site collection features level) of all site collections. it shows up at the site features level (not site collection features level) ready to be activated when they should be activated already.
Is it that the default deployment has something to do with my dev settings where it only deploys to the root url? So since I use a predeployment command script to delete and recreate all three sites, is it possible that these other two sites are merely picking up the features scoped to "web" upon creation, but the actual activation part of the deployment was never run on them and instead just the root site collection? If so, why? I think it's very important that I understand this thoroughly before I go anywhere near a production env.