Saturday, July 16, 2011

Activate only selected features while deploying a solution package in Visual Studio 2010

In Visual Studio 2010 SharePoint Developer Tools is what we use to develop quick solutions to SharePoint. With these tools we can quickly deploy into SharePoint environment as well. But, the only issue we see here is, if we are trying to deploy a package which contains a set of 5 features then all of them will be activated by default. But, this might not be a valid behavior for us. We need to activate only 3 features while deploying the package and the other 2 features need to be installed into SharePoint but should not be activated. So, this is not available by default in the SharePoint Development Tools in Visual Studio 2010.

Recently when I was browsing in internet for this, how to deploy only selected features into SharePoint, but not all and found a great Visual Studio 2010 Extension. Which is a great tool to use and works perfect.

Download the extension here.

Once you get his extension, directly run it by double clicking on it. Before you see the changes, close any existing Visual Studio instances and reopen them. The extension will be added to Visual Studio 2010 and ready to use. But, to use it in your SharePoint project, you need to do one more exercise.

  1. When you right click on your SharePoint project you will see a new entry in the menu item as shown below.
  2. Before you start using it, right click on the project and select "Properties".
  3. From the "SharePoint" tab, click on the New button to add "Active Deployment Configuration" as shown in figure.
  4. From the "Active Deployment Configuration" drop down, select the new configuration we just created.
  5. The configuration is same as others but the only extra action here is "Activate selected features" custom extension.
  6. Now, we are ready to use this feature. Right click on project, select "Select Features to activate…" and you will be open up with a window as shown below.
  7. Now, you can build and deploy, you will see only the selected features will be activated only.
What a nice feature, I really need it in almost all the times. Thanks to Mavention for the great VS extension.

No comments:

Post a Comment