In previous posts, we discussed various techniques to tailor your Team Foundation Server (TFS) Build Process. The TFS Versioning article introduced a library, which enables you to set the assembly versions during the build. The TFS Merge post demonstrates the steps necessary to provide a merge process within the TFS Build Process Template. In this article, we explore the Build Process Parameters of the TFS Build Process Definition.

After you successfully compile and test, the final step is packaging and/or publishing the product for deployment. If your build process definition includes multiple source solutions then collecting the assets required to deploy is tricky. In most scenarios, you will move the packages and artifacts to a share or drop location. The versioning process provides a unique identifier, so you can properly label or tag the deployment release. If you create a share folder name with the generated version then you can catalog and track the deployment releases.

The MSBuild command-line provides a series of parameters instructing the build to perform one or more defined operations. The parameters will override any solution or project specific values, which is helpful to ensure the results are consistent for packaging and publishing.

The MSBuild Parameters is an Advanced section option, which provides the override instructions to the build process. The web projects are packaged to include the required assets to deploy, which appear as a “_PublishedWebsites” folder. A SharePoint Solution Package (.wsp) and SQL Server DAC Package (.dacpac) are other examples of deployment packages.

The following MSBuild parameters will ensure the above packages are created during the build process.

TFS Build Definition MSBuild Arguments

The OutputPath parameter is optional, but will move results to the bin folder. This includes the web, SharePoint and SQL Server deployment packages discussed previously. The WarningLevel parameter is set to zero, so all warning messages are suppressed.

I hope this information is helpful, so you can customize your build process and capture the deployment packages without writing significant custom logic.