How to use a custom response file with TFS 2008 build
// May 14th, 2008 // 2 Comments » // Team Foundation Server, Visual Studio.Net
A Team Foundation Server 2008 build uses 2 important files – the build file (TFSBuild.proj) of course and the response file (TFSBuild.rsp). A response file is used to pass configuration parameters to MSBuild process. By default, the build uses TFSBuild.rsp as the default response file.
Here’s the content of a sample response file.
# This is a response file for MSBuild
# Add custom MSBuild command line options in this file
/p:BuildPath=Source\Ordering\Source.Binaries\
/p:BTSPath="E:\Program Files\BizTalk 2006 Runtime"
/p:BiztalkLibsPath=Source\Ordering\BiztalkLibs\
/p:ExternalLibspath=Source\Ordering\ExternalLibs\
/p:IntegrationServerName=bztlk-m009
/p:IntegrationBizTalkDB=BizTalkMgmtDb
/p:WCFServiceDropLocation=\\bztlk-m009\Mi360\eCommerce.Ordering.ServiceHost
/p:BizTalkHelperDropLocation=\\bztlk-m001\Staging
/p:IntegrationBizTalkInsallDir=BizTalkInstall
/p:IntegrationStagingDirectory=E:\Staging
/p:PsToolPath=E:\Software\PsTools
/p:CodeAnalysisRules="-Microsoft.Design#CA1020;-Microsoft.Design#CA1031;-Microsoft.Globalization#CA1302;-Microsoft.Usage#CA2227;"
/p:BizTalkServerPassword=temp
/p:BuildBranch=MainDev-Branch
/p:AccountsApplication=http://test-m001/Accounts/Accounts.mvc
As you can see above, there are quite a few parameters that you can use in the proj file (which by the way, is by using $<insert_parameter_name_here>.
For example, <BizTalkFiles Include="$(SolutionRoot)\$(BuildBranch)\$(BuildPath)*.dll" />
Now sometimes you might need the build to use a custom response file instead of the default one. For example, if you want to have just one master build file that would use different response files depending on the type of deployment (QA, Development, Testing etc.), you need a way to pass in the response file.
Here’s how you do it using Visual Studio 2008.
1. Right click on the Build Definition you want to use (in my case the build definition is called Interactive as you can see below) under the Builds folder in your Team Explorer window and click Queue New Build.
2. In the MSBuild command-line arguments (optional) text field, type @ followed by the location of the response file you want the build to use.
3. And click Queue.
I have written a little windows deployment helper that would do all this and much more for you. For example, it would help deploy builds by TFS labels. I’m thinking about putting it on codeplex after cleaning it up a little bit. Will write about it here soon…





