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?
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.
You can either remove '*' from your version string, or disable determinism in your project file by setting the MSBuild property `<Deterministic>false</Deterministic>`.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With