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
  • 96,194
  • 31
  • 221
  • 232
1

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

Geoffroy
  • 12,113
  • 4
  • 47
  • 97
Patrick Desjardins
  • 131,236
  • 84
  • 290
  • 340
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
  • 20,210
  • 7
  • 48
  • 84
0

Setting it as such should do so:

[assembly: AssemblyVersion("1.0.*.*")]
hangy
  • 10,584
  • 6
  • 43
  • 62
  • 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