使TeamCity版本与.NET程序集版本匹配 [英] Making TeamCity Version Match .NET Assembly Version

查看:75
本文介绍了使TeamCity版本与.NET程序集版本匹配的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现在,我们的程序集的版本号如2.0.831.0。据我了解,这是主要版本,次要版本,日期和内部版本号。如果我进行更改并在同一天再次构建,则为2.0.831.1、2.0.831.2等。

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 again on the same day it's 2.0.831.1, 2.0.831.2 etc.

我的TeamCity内部版本号格式仅为2. {0},其中{0}是一个永远递增的自动递增数字(2.195、2.196等)。

My TeamCity build number format is simply 2.{0} where {0} is an auto incremented number that just goes on forever (2.195, 2.196 etc).

如何使TeamCity看起来完全像程序集版本?我们希望能够将更改日志与程序集版本相关联,以便任何人都可以说程序集版本2.0.831.2在这些文件中进行了这些更改。

How do I make TeamCity look exactly like the assembly version? We want to be able to associate the Change Log with the assembly version so anyone can say assembly version 2.0.831.2 had these changes in these files.

其他信息:
如果重要的话,我们的构建步骤将使用 Visual Studio(sln)选项而不是 MSBuild。
如果重要的话,我们使用Subversion进行源代码控制。
我们的TeamCity版本为6.5.1(内部版本17834)。

Extra info: Our build step uses the "Visual Studio (sln)" option instead of "MSBuild" if that matters. We use Subversion for source control if that matters. Our TeamCity version is 6.5.1 (build 17834).

推荐答案

我建议您采用语义版本控制方案 {major}。{minor}。{patch} 和为内部版本号 {major}。{minor}。{patch}。{build} 附加第4个元素。
这对于将构建日期包含在版本控制方案中更为有用。

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(您尚未指定版本)具有构建功能在构建期间,可以使用该补丁来修补AssemblyInfo.cs中的版本。请参见 AssemblyInfo Patcher 的文档。

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.

然后,您可以按照自己希望在装配体中使用的方式定义内部版本号格式,并将其用于内部版本本身以及修补功能。

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.

这篇关于使TeamCity版本与.NET程序集版本匹配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆