We are evaluating TFS On Premise, including the Package Management feature.
I have several build configurations that successfully create NuGet packages and publish them to the feed within TFS.
Versions of the package are controlled via the AssemblyInfo.cs file within the solution. For example: [assembly: AssemblyInformationalVersion("1.0.0.0")]
results in a NuGet version 1.0.0.0; using AssemblyInformationalVersion
because you can apply pre-release tags to your version, such as [assembly: AssemblyInformationalVersion("1.0.0.0-dev")]
resulting in verison 1.0.0.0-dev
Is there a way of setting up the build configuration to modify the AssemblyInformationalVersion
based on the branch being used for the build?
So that we can have [assembly: AssemblyInformationalVersion("1.0.0.0")]
in code, but when building off branch "myNewFeature" it result in "1.0.0.0-myNewFeature" and building off master can result in ""1.0.0.0"? Rather than having to make this change to the AssemblyInfo.cs file each time we merge to a different branch.