user3799325
user3799325

Reputation: 620

Update Assembly version with TFS label

When i apply TFS Label, i also want to update the Version on source code file to whatever i put in label. We label each release in the TFS intermediate build versions does not matter, more interested in the TFS label

Is this possible ? is so how can it be achieved ?

Upvotes: 2

Views: 644

Answers (1)

jessehouwing
jessehouwing

Reputation: 115037

By default: No. Normally the Label is placed in Tfs after the build if done, plus the code being compiled is the code checked in, not the code that is generated during the build process. There are a few options though.

  1. Customize the build process template to update the AssemblyInfo.cs file prior to invoking MsBuild and move thecode to label the sources to the start of the build workflow (this will also cause failed builds to be labelled unless you add more fancy customization. Basically look at the changes described here. There are numerous issues with this approach, especially if you want to rely on Intellitrace, Debug Symbols and Source Indexing. Test Impact Analysis may also be impacted by changing the sources during the build.

Much better solution:

  1. Create a small visual studio extension, powershell script or custom console app that updates the AssemblyInfo.cs, applies the label and then queues the build with that specific label as its source control version. This puts all the updates outside of the TFS build workflow and ensures that the previously mentioned build steps are not affected by any of your customizations.

Upvotes: 1

Related Questions