使用星号时是什么导致程序集版本递增? [英] What causes Assembly Version incrementation when using asterisk?

查看:24
本文介绍了使用星号时是什么导致程序集版本递增?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我有一个汇编版本,例如:

If I have an assembly version such as:

[assembly: AssemblyVersion("2013.7.18.*")]

当这个版本号被读取时,它会类似于2013.7.18.123.

When this version number is read, it will be something like 2013.7.18.123.

是什么导致了最终数字的递增?

What causes the incrementation of the final number?

推荐答案

递增,这将要求构建系统知道以前的版本.它没有这样的知识.您实际上是在获得一个随机数.这不是随机的,修订号是从一天中的时间生成的.内部版本号也可以是随机的,它是从日期生成的.

It is not incremented, that would require the build system to know the previous version. It has no such knowledge. You are essentially getting a random number. It isn't that random, the revision number is generated from the time of day. The build number can also be randomized, it is generated from the date.

请注意使用 2013.7.18.* 的后果,您不能保证它是唯一的.如果您在完全相同的时间进行构建,那么您将获得完全相同的数字.它也不会自动成为更大的版本号,早点构建你会倒退.这些不是版本号的重要属性.

Do note the consequence of using 2013.7.18.*, you have no guarantee that it will be unique. If you ever build on the exact same time then you'll get the exact same number. It also won't automatically be a larger version number, build earlier and you'll go backwards. These are not great properties of a version number.

或者换句话说,只使用 1.0.* 真的很有意义,它会生成一个总是增加的版本号.因为内部版本号总是更大.

Or in other words, only using 1.0.* really makes sense, that generates a version number that always increases. Since the build number will always be larger.

同样值得注意的是,您确实尝试将日期放在版本号中.你已经知道了,如果你让它选择构建号,你总是可以从结果中逆向工程构建日期.内部版本号是自 2000 年 1 月 1 日以来的天数,修订版号是自午夜(无 DST 更正)以来的秒数除以 2.

It is also notable that you do try to put the date in the version number. You already get that if you let it pick the build number, you can always reverse-engineer the build date from the result. The build number is the number of days since Jan 1st, 2000, the revision number is the number of seconds since midnight (no DST correction), divided by two.

这篇关于使用星号时是什么导致程序集版本递增?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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