Frostbitten

I have team project with a couple of build types in it.

I am using AssemblyInfoTask to update assembly version and put updated AssemblyInfo.cs'es back under control. So now in every build type project (TFSBuild.proj) I have to copy this AssemblyInfoTask functionality (and also some custom deployment stuff like rar'ing build results before drop, etc).

This common for all build types functionality can be easily extracted to custom .targets file and imported to each .proj project.

But I havent see any suitable place to put this .targets file. I see following solution (not working and not working for me :)

  1. Placing .targets to the $(TeamProject)\TeamBuildTypes directory. This is not working because this folder is not being checked-out before <import> instruction in the .proj file processed.
  2. Placing .targets under $(MSBuildExtensionsPath). This may work fine, but not for me, as I want all my custom build environment to be under source control (otherwise future changes in .targets file will make old build runs irreproducible.

Are there any more options

Though I can live with redundant duplications in build project, but as developer I experience some discomfort knowing of potential problems as more build type are added.



Re: Team Foundation Server - Build Automation Extracting common parts of build proj's to controllable .targets

DQM

I put my custom targets files in TFS under TeamBuildTypes/<TeamBuild> folder. That does mean that if there is a common targets file it will have to be copied to the all the build folders that use that file. I don't have that many so it is not a major issue.






Re: Team Foundation Server - Build Automation Extracting common parts of build proj's to controllable .targets

Aaron Hallberg - MSFT

DQM's suggestion is, unfortunately, your only option at this point if you want the targets file in source control. If not, you can get away with installing this file on each build machine, as you have already figured out. This is certainly on our radar as a "pain point", and we plan to address it at some point in the future.

-Aaron