Friday, January 25, 2008

Team Build: Modify TFSBuild.proj Template File

One of the usually made changes in all TFS Builds are setting some Targets and Properties for each and every build. Changing the Microsoft.TeamFoundation.Build.targets is not a supported and risky scenario as it can be changed from version to another (as happened between TFS05 & TFS08) so the best option is customizing the Template file that generates the TFSBuild.proj file to include those changes by default.

The template can be found in:
  • [VS2005] C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies\1033\tfsbuild.proj
  • [VS2008] C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\1033\tfsbuild.proj

Note that those templates are found in the PrivateAssemblies folders which can be overwritten by Maintenance and/or Updates so always make sure the output file is correct

All you have to do is to add your Custom/Overriden Targets, Properties or ItemGroups in their needed locations and Copy the file to each Machine that will create a Team Build.

Hope that helps.

Thanks to Steve for the info

No comments: