Making TeamCity Version Match .NET Assembly Version

后端 未结 2 573
一个人的身影
一个人的身影 2021-02-02 15:25

Right now our assemblies have a version number like 2.0.831.0. As I understand it, that\'s major version, minor version, date and build number. If I make a change and build ag

2条回答
  •  囚心锁ツ
    2021-02-02 16:09

    I would recommend you to adopt the semantic versioning scheme {major}.{minor}.{patch} and append a 4th element for the build number {major}.{minor}.{patch}.{build}. This is way more useful as to include the build date into the versioning scheme.

    TeamCity 6.5 (you haven't specified a version) has a build feature which could be used to patch the version in the AssemblyInfo.cs during the build. See the documentation for the AssemblyInfo Patcher.

    AssemblyInfo patcher dialog (TeamCity documentation)

    You could then define the build number format in the way you would like to have in your assembly and use the format for the build itself, as also for the patching feature.

提交回复
热议问题