Saturday, July 21, 2012

Feature activation and deactivation

Before learning about Feature Activation and Deactivation, we need to first learn about Features.



There are few key terms that you need to remember when it comes to working with Features deployment.
1. Install
2. Activate
3. Uninstall


4. Deactivate
When working with Visual Studio, deployment a feature is as easy is right clicking your project and selecting Deploy from context menu (assuming all the default settings are in place and there are no build errors)

However you will not have the luxury of Visual Studio when it comes to either staging or production environments. You will have to do something new to deploy your features. Learn PowerShell commends.

Once you have your feature developed, tested and ready to deploy, click Start> All Programs> Microsoft SharePoint 2010 Products> SharePoint 2010 Management Shell

Install a feature
Install-SPFeature -path "MyCustomFeature"
Activate a feature
Enable-SPFeature –identity "MyCustom" -URL http://somesite
Deactivate a feature
Disable-SPFeature –identity "MyCustom" -URL http://somesite
Uninstall a feature
Uninstall-SPFeature -path "MyCustomFeature"

My personal favorite link which explains Solution deployments instead of Features is a very useful link.

 


No comments: