After dig and search. I find that AssemblyVersion
only accept System.Int16
That mean it can't exceed 65,535 value.
the output *.DLL assembly version style I need (YYYY.M.D.HHMMSS) (2022.02.20.060920)
Actually the second part first zero will omit 060920 It will be 60920, What if hour is 15 = 3 PM, It should be 150920 = 6 digits. It will not work. I guess there's a way DateTime.Now.Ticks but it gave a System.Int64
and will never works for Version.
So please is there any 5 digit hour/minute/second style that maybe can used here? Or maybe special 5 digit Tick that have meaning.
The main problem that when I use Visual Studio auto-increment Revision 1.0.0.* feature. It gives arbitrary increment value. And the package output are not ordered.
What should I do now? For now I need to use Time for revision field... Can you help on that please?
Edit, If 5 digit style not avaiable for above. I found article increment revision by one. But its very very old and use JavaScript! https://www.codeproject.com/Tips/161923/Incrementing-AssemblyVersion-revision-number-on-ea
There's also question not answered which still new I would like to increment the build revision version for every build in visual studio
I got following code which get Version 2022.02.20.Revision (Revision are useless during its restricted to large value midnight * 2 from MSDN.
Edit: During the only extension in VS marketplace that do that is not updated to Visual Studio 2022 or maybe they will not supported it, I try to give solution below:
(Feel free to modify Answer if you have better approach)