简体   繁体   中英

Update Changed Assembly Version Number TFS Build

I'd like to be able to automatically update the assembly version off all changed projects on a TFS check-in. We'd like to do this as part of our gated check-in so that developers don't have to remember to manually update those numbers on every check-in.

My current approach would be to:

  1. Determine what projects contains changes on check-in
  2. Check out the AssemblyInfo.cs in each project with changes
  3. Increment the version number in each AssemblyInfo.cs file
  4. Begin build process

I assume there is a way to accomplish this using a combination of PowerShell and customizing the TFS build template, but have little familiarity with either. Any help on the matter would be greatly appreciated.

Use the script located here as a pre-build script in your build template.

The script will change all AssemblyInfo.cs files that are found with the build number.

How to update assembly version of your projects using PowerShell scripts. A very good guide.

The answer is bit late but you can find a good guide here , Have a look into that

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM