4

How can I AutoIncrement the assembly (build) number in Visual Studio?

Duplicate:

/questions/650/automatically-update-version-number

Community
  • 1
  • 1

4 Answers4

5

You can just use a wildcard in the AssemblyVersionAttribute:

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

This will cause build to be equal to the number of days since January 1, 2000 local time.

Mark Cidade
  • 98,437
  • 31
  • 224
  • 236
1

Maybe this is what you want from Code Project. Otherwise, you can do it from the property of the project by using the *.

Jaffa
  • 12,442
  • 4
  • 49
  • 101
Patrick Desjardins
  • 136,852
  • 88
  • 292
  • 341
1

I use http://code.mattgriffith.net/UpdateVersion/ in a batch file as a pre-build step with calls to interact with our revision control system.

kenny
  • 21,522
  • 8
  • 49
  • 87
0

Setting it as such should do so:

[assembly: AssemblyVersion("1.0.*.*")]
hangy
  • 10,765
  • 6
  • 43
  • 63
  • 2
    The `*.*` solution doesn't work. It uses "time of day" numbers which means generated files won't install from a .msi unless generated at a later time on any subsequent day. Make one late at night, and you're stuck. Can't seem to find a link for this, but I do recall using it was very painful. – Matt Connolly Feb 15 '12 at 01:31