Question

If I have an assembly version such as:

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

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

What causes the incrementation of the final number?

Was it helpful?

Solution

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.

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.

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.

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.

OTHER TIPS

AssemblyVersionAttribute Class:

You can specify all the values or you can accept the default build number, revision number, or both by using an asterisk (). For example, [assembly:AssemblyVersion("2.3.25.1")] indicates 2 as the major version, 3 as the minor version, 25 as the build number, and 1 as the revision number. A version number such as [assembly:AssemblyVersion("1.2.")] specifies 1 as the major version, 2 as the minor version, and accepts the default build and revision numbers. A version number such as [assembly:AssemblyVersion("1.2.15.*")] specifies 1 as the major version, 2 as the minor version, 15 as the build number, and accepts the default revision number. The default build number increments daily. The default revision number is random.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top