Auto increment the build number in the 'AssemblyVersion'

Q) How to auto-increment the build number of the ‘AssemblyVersion’ in a managed application?

A) Locate the AssemblyInfo.cs (or VB) file and make the following change - [assembly: AssemblyVersion("1.0.*")] – Voila!!! The assemblyversion should now automatically change after each build. However, be warned – changing the buildnumber in a class library would result in the recompilation of all dependent assemblies.

Comments

  • Anonymous
    October 11, 2006
    The comment has been removed
  • Anonymous
    August 13, 2007
    It works... but... increment is not sequential. for example, I have run several times and I get: 1.0.2782.397 1.0.2782.416 1.0.2782.423 next day: 1.0.2783.560 I would like to start in: 1.0.0.x, then 1.0.1.x and so on. I do not want to start in a higer number. Thanks, Bye