Incrementing Assembly Version

Jan 28, 2013 at 4:13 PM


We have our build version numbers set to 2.2.(Iteration).(revision). Our iteration changes once every 6 months, so at the moment we are on, but shortly it will change again. I have been using the following as the AssemblyFileVersion format: 2.2.112.b, but didn't realise this resets at the beginning of each day. How do I make it so that within any given time period, the last digit will always increment by 1 up until we move the iteration on. 

For example:

Build today should be
Build tomorrow should be
Build next iteration should be


Jan 28, 2013 at 5:30 PM

The "b" pattern macro uses the revision number provided by TFS and it comes from the Build Number Format: $(BuildDefinitionName)_$(Date:yyyyMMdd)$(Rev:.r).  The revision number resets back to 1 if any part of the rest of the format changes.  Since the yyyyMMdd changes every day you can make it stop if you take out the date parameters.  If you do, I would put in something (simple text would do) that you could change manually to reset the revision back to 1 when you wanted.  It will then increment indefinitely.