0

How do I auto increment assembly version in my Assembly.cs file so that it is a custom increment like 1.4.001 and then each build after is 1.4.002 and so on.

Currently if I use

[assembly: AssemblyVersion("1.4.*")]

it returns 1.4.6865.30445

mlynn
  • 59
  • 6
  • 1
    Would this incremented version only apply to your machine? i.e. if you build on yours you'll get `1.4.003`, and then if I clone the code and build on my laptop I'll get `1.4.001`? – Kirk Broadhurst Oct 22 '18 at 20:49
  • The only way that I know how to do this is to create an application (or powershell script) that can parse the Assembly.cs file and run that as part of the pre-build step. There is nothing built-into VS that does that. If you are using Team Services Source Control I think there is some settings that can adjust it though. – Ron Beyer Oct 22 '18 at 20:49
  • Possible duplicate: https://stackoverflow.com/questions/826777/how-to-have-an-auto-incrementing-version-number-visual-studio or https://stackoverflow.com/questions/356543/can-i-automatically-increment-the-file-build-version-when-using-visual-studio – CodeLikeBeaker Oct 22 '18 at 20:49

0 Answers0