5

I setted AssemblyVersion attribute to this: [assembly: AssemblyVersion("1.0.0.*")]

It is increasing according to change of assembly and time. Now it is: {1.0.0.20042} and if I don't change cs files inside assembly it doesn't increase. But if I change the one of class file in this assembly, version isn't increasing just one. If I didn't misunderstand the articles it is increasing depend on time. But I want to set this increament depend on build number.

Is there any way to learn build number from this version number or to set it's increament 1 ?

Jens Björnhager
  • 5,632
  • 3
  • 27
  • 47
uzay95
  • 16,052
  • 31
  • 116
  • 182
  • 1
    For the record, it makes very little sense to do this. [AssemblyVersion] is a big deal in .NET, changing it requires all code that uses the assembly to be recompiled. What you are doing now makes the assembly incompatible with all code that uses it, even if no change was made. Just recompiling is enough to break the client code. That makes no sense whatsoever, you only want to change the [AssemblyFileVersion]. – Hans Passant Feb 09 '12 at 10:58

1 Answers1

5

I use Auto Version Increment for Visual Studio. It's free and works for VS2005/08 and has a separate version for VS2010.

You can select all sorts of policies on build incrementing, including per-build increment and time based build numbers.

If you've got multiple projects and want to keep the version numbers the same, you can create a shared AssemblyInfo.cs between all projects, then increment the build version in that.

Polynomial
  • 27,674
  • 12
  • 80
  • 107