Search code examples
buildtfsbuild-processtfsbuild

Assign Global Variable/Argument for Any Build to Use


I have several (15 or so) builds which all reference the same string of text in their respective build process templates. Every 90 days that text expires and needs to be updated in each of the templates. Is there a way to create a central variable or argument


Solution

  • One solution would be to create an environment variable on your build machine. Then reference the variable in all of your builds. When you needed to update the value you would only have to set it in one place.

    How to: Use Environment Variables in a Build

    If you have more than one build machine then it could become too much of a maintenance issue.

    Another solution would involve using MSBuild response files. You create an .rsp file that holds the property value and the value would be picked up and set from MSBuild via the command line.