0

I'm using TFSBuildExtensions to auto version my libraries.

I've got the build template modified so that it does that nicely. Although it doesn't actually update the AssemblyInfo.cs file.

Now I would like that AssemblyFileVersion attribute in the AssemblyInfo to update in source control. How can that be done and why isn't that being done by any of the projects I've seen out there?

Is there a reason not to have this updated in source control? (essentially checkout the file and update it.)

DaveShaw
  • 52,123
  • 16
  • 112
  • 141
user1161137
  • 1,067
  • 1
  • 11
  • 31

1 Answers1

1

The way I see it, if you want to update the Version number of your assemblies you have 2 choices:

  1. Update the one(s)* in source control and then read them on build to get the version. You can update the existing version with Regex replaces, custom scripts, etc.
  2. Get the build to set the version numbers as it goes.

If you are doing #1, you don't need #2.

If you are doing #2, it's normally because you don't want a check-in for each version - otherwise you would just do #1 :). What you are suggesting doing is automating #1 on check-in, albeit after you edit the version number in the build definition, so it isn't without user interaction.

If you really want this, you'll have to mess with the template a bit more, people who use the extension you linked normally just do #2.

* You can link many projects to a single file if you want.

DaveShaw
  • 52,123
  • 16
  • 112
  • 141