Speed up deployment of SharePoint solution on a development machine

This post will help you to speed up the deployment on a developers machine if you use a batch file that is called from a postbuildevent on the project.
The deployment of a SharePoint solution usually consists of following parts:
1. Copying assemblies to GAC
2. Copying files to 12 folder
3. Reinstalling/reactivating features
4. iisreset/recycling SharePoint apppool
Resetting apppool instead of iisreset will save you also some time

The idea of speeding up is that many times we can skip the step 3. Actually we need the step 3 only when we modify the xml of features or introduce a new feature.
So we will split our postbuild.bat file to two files 1. postbuild.bat, 2. installfeatures.bat. In the installfeatures.bat there will be deactivating/uninstalling/installing/activating of all features. In the postbuild.bat will stay the rest.
Then we will create our new Solution Configuration. So click on the DropDown on the toolbar in Visual Studio, where Debug is usually displayed. Then click Configuration Manager. In the Configuration Manager create a new Solution Configuration named Quick Debug, that will be based on Debug mode.
Now open the project settings and modify the postbuild event as following:

call "$(ProjectDir)postbuild.bat"
IF "$(ConfigurationName)"=="Quick Debug" (call "$(ProjectDir)installfeatures.bat")

Now if we want to Quick deploy the solution we just select the configuration Quick Debug. If we play around with feature we will use Debug or Release configuration.


Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: