Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What causes Assembly Version incrementation when using asterisk?

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?

like image 950
Curtis Avatar asked Jul 18 '13 09:07

Curtis


People also ask

Can I automatically increment the file build version when using Visual Studio?

By default, Visual Studio automatically increments the Revision number of the Publish Version each time you publish the application. You can disable this behavior on the Publish page of the Project Designer.

How do I disable determinism for compilation?

You can either remove '*' from your version string, or disable determinism in your project file by setting the MSBuild property `<Deterministic>false</Deterministic>`.


1 Answers

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.

like image 136
Hans Passant Avatar answered Oct 10 '22 19:10

Hans Passant