Create web deploy package during a tfs 2010 build

Web projects in VS2010 has a great flexibility when it is time to deploy to the server, and it has a great option to generate a Deploy Package with a single click

image

But if you build a web project with a tfs2010 build you can verify that in the drop folder you simply have the published web site that contains only all the files, and not package to install

image

To generate the deploy package during a build you need to set to true a couple of msbuild properties

  • /p:CreatePackageOnPublish=true /p:DeployOnBuild=true *

These two properties ask to MSBuild to generate the build deployment package during the build. You can put them in the MSBuild Arguments part of the build definition, it is really simple

image

If you run this build, you can verify from msbuild log that the package was generated.

image

The good part is that if you look at the drop folder you can notice that the build automatically copied the Package into the output.

image

This is good because you will end with an installable web site always available in the drop folder.

alk.