I want to auto active feature when deploy solution from central admin site. it is auto activated successfully when I deploy solution from visual studio. How can I auto active feature when deploy solution from central admin site ? My feature is in Site Scope.

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.

You need to write custom code to programmatically activate the feature.


How to enable site collection feature by default when deploying a visual webpart from visual studio?

Feature not activated by default


Visual Studio activates the Feature while Deploying.

That isn't happening anymore the way you deploy it.

The easiest way would be to create a Feature Event Receiver hooking to FeatureInstalled.

Use roughly the following line in there:

SPWeb web = properties.Feature.parent as SPWeb;

Your Answer

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

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