This project is read-only.


This recipe provides the configuration for deploy a website to the Build Server IIS after completed a Build.

Software Requisites

Install Visual Studio 2005 Web Deployment Projects on Build Server



Install Visual Studio 2008 Web Deployment Projects on Build Server


UnZip PSTools on Build Server at "c:\PSTools"


Other Requisites

Shared Folder on the Target Server

Example: \\TargetServer\BuildDeploy\

Administrator Rights for the Build Server Account on the Target Server


1.- Add a Web Deployment Project to your Web Site.


2.- Add a Web Setup Proyect.

Configure in the File System Editor, Add a new "Project Output" under the folder "Web Applicator Folder" and select as project the "Web Deployment Project" created before.

3.- Create a new Build Type and make sure that run under "Release|Mixed Platforms".

4.- In the "Configuration Manager" window, create a new configuration named "Deploy".

Select all the Projects for Build including the Web Deploy Project and the Web Setup Projects.

5.- Run the Build Type.

At this point the build should succeed with no problems.


Open the "TFSBuild.proj" of the Build Type and add the script at the bottom of the file, before the "</Project>" tag.


<!-- Add a new Target named "AfterCompile" or override if exist -->
<Target Name="AfterCompile">

    <!-- Call devenv to compile the "Web Setup Project" because Team Build doesent support "Setup Project Types" -->
    <Exec Command="&quot;$(VSINSTALLDIR)\Common7\IDE\devenv&quot; &quot;$(SolutionRoot)\Application\Application.sln&quot; /build &quot;Deploy|Mixed Platforms&quot;" />

    <!-- Copy the MSI File to the Output Directory -->
    <Copy SourceFiles="$(SolutionRoot)\Application\WebSetupProject\Deploy\WebSetupProject.msi" DestinationFolder="$(OutDir)" />

    <!-- Copy the MSI File from the Output Directory to the Shared Folder on the Target Server -->
    <Copy SourceFiles="$(OutDir)\WebSetupProject.msi" DestinationFolder="\\TargetServer\BuildDeploy\" />

    <!-- Uninstall a previous version of the "Web Setup Project" -->
    <!-- Add the parameter IgnoreExitCode and ContinueOnError, to avoid the build failure if the Target Server doesent have a version installed -->
    <!-- Under "SETUP-PRODUCT-CODE" you have to add your "Web Setup Project" Product Code. Example: {94078030-4499-41FD-9015-E057EB103DF9} -->
    <Exec Command="&quot;c:\PSTools\psexec&quot; \\TargetServer /accepteula MSIExec /x &quot;SETUP-PRODUCT-CODE&quot; /qn" IgnoreExitCode="true" ContinueOnError="true" />

    <!-- Install the new version of the "Web Setup Project" -->
    <Exec Command="&quot;c:\PSTools\psexec&quot; \\TargetServer /accepteula MSIExec /i &quot;\\TargetServer\BuildDeploy\WebSetupProject.msi&quot; /qn" />



This build recipe was made by Juan José Karam -


If you have any problem or questions about this Build Recipe you can post me a comment at


This build recipe is provided "AS IS" without warranty of any kind.

Last edited Nov 2, 2010 at 7:12 PM by wbarthol, version 2


No comments yet.