In Visual Studio 2010 you can actually modify the deployment configuration and steps. By default you will get the following:
– Default
– No Activation
Default
With the default one, when you do “Right Click -> Deploy” VS will then retract your solution, re-deploy your latest solution and re-activate the features.
No Activation
With this option it will do as Default except it won’t activate the features.
You can also create your own deployment step. However, the list of steps are quiet limited. You can only choose from the following:
– Run Pre-Deployment commands
– Recycle IIS Application Pool
– Retract solution
– Add solution
– Activate features
– Run post-deployment commands
It would be nice to have an “Upgrade” option. The reason is because, with content types and columns especially, since they’re the core of Sharepoint development project, if you try to retract, re-add solution then re-activate the feature that deploys content types and features, it may break your Sharepoint site completely.
Plus, if you have a feature that creates content (eg. pages and sites) programatically, you obviously will not want it to be activated twice.
I tried to also open the .csproj file with the hope that I can somehow “hack” it but it actually calls a class with namespace:
<DeploymentConfiguration Name=”Upgrade Solution”>
<DeploymentSteps>Microsoft.VisualStudio.SharePoint.PreDeploymentCommand;Microsoft.VisualStudio.SharePoint.RecycleApplicationPool;Microsoft.VisualStudio.SharePoint.RetractSolution;Microsoft.VisualStudio.SharePoint.AddSolution;Microsoft.VisualStudio.SharePoint.PostDeploymentCommand</DeploymentSteps>
<RetractionSteps>Microsoft.VisualStudio.SharePoint.RecycleApplicationPool;Microsoft.VisualStudio.SharePoint.RetractSolution</RetractionSteps>
</DeploymentConfiguration>
Therefore, at this stage I still don’t know how to add my own “Upgrade” deployment step.
Hopefully this will be fixed in the released version of VS 2010.
** UPDATE **
This article actually mentions what I want to exactly do:
http://msdn.microsoft.com/en-us/library/ee256698(VS.100).aspx
I’ll try that soon and let you know how it goes.
Cheers,
Tommy