Look at the task version at http://msbuildtasks.tigris.org/
This will allow you to update the assembly assembly.cs assembly.
This still leaves an “how” to identify the branch ...
You can devote one part of the major.minor.build.revision branch to the risk of religious debate on versioning. For example, major.minor simply follows your "external / commercial" version number, build is a TFS string type form, and version 1 points to your main branch, version 2 points to a specific branch. You can also use other assembly version attributes, such as AssemblyInformationalAttribute, to store the branch identifier in it.
I'm not completely updating how you can find the branch you're in, but in the worst case, it's just a matter of getting the current directory and applying some logic to display the branch name. The output of the tf branch. the command should also give you the branch name for the current workspace, but you will need a custom task to retrieve only the first row.
Not an answer to plug and play, but it can lead you in the right direction.
rene
source share