I have a SP2010 wsp that contains multiple features all are scoped "web" all was working fine. But suddenly one of the feature stopped activating by default on deployment though all other features are activated. I checked for the "Activate On Default" property which is set to true. But it seems to have no effect on activation.I can go to features list in my site and activate the feature manually and there is no error and feature performs what its intended to.

Tried to even debug the feature receiver code (using VSSHost) but that too doesn't work.

Any help will be appreciated.

2 Answers 2


The ActivateOnDefault attribute does not apply to site collection (Site) or Web site (Web) scoped Features.

It only determines if Farm or WebApplication scoped features are activated by default when deploying. And in case of WebApplication scoped when a new Web Application is created.

This has nothing to do with the automatic activation which Visual Studio performs as part of its deployment.

Is your feature deployed, but just not activated? If not hidden it should show up in Site features below Site Settings. If not here then look in the Package Designer to verify that the feature is included in the Package.

If it's deployed, but not being activated, then try to activate it through UI or PowerShell to see if there is any errors. As you mention you have a feature receiver it might be best to use a newly opened "SharePoint 2010 Management Shell", attach debugger and run Enable-SPFeature

  • Yes my feature gets deployed and comes up in the feature list but not auto activated as earlier.I can manually activate it without any errors.
    – V.B
    Commented Jul 30, 2012 at 11:20
  • Have you tried to manually activate it through PowerShell? A common mistake is to use SPContext.Current in the FeatureReceiver, which only works when activating though the UI Commented Jul 30, 2012 at 11:24
  • Yea I tried to activate using enable feature but it complains about scope of the feature that this feature is "Site" scoped and it complains about the URL as it has sub site as a part of it. I am aware of NOT using SPContext in feature receiver as it will always be null. Thing is it used to activate automatically earlier but something is there that I am not able to identify.
    – V.B
    Commented Jul 30, 2012 at 11:33
  • Have you checked the scope of the Feature? If the scope is Site and the SiteUrl in VS is to a Subsite it wont automatically activate it. If it worked before, then it may have become broken, by changed Scope or url being changed to not being RootWeb. Commented Jul 30, 2012 at 11:42
  • I resolved the problem. It lied with VS environment.Another copy of solution worked fine.
    – V.B
    Commented Jul 31, 2012 at 10:57

1) In Solution Explorer, expand Features.

2) Double-click the Feature item.


2) Right-click the Feature item, and then click View Designer.

3) Click Manifest.

Check the value of the ActivateOnDefault attribute.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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