11

This question asked how to auto update version number in VS 2010 : https://stackoverflow.com/questions/4025704/publishing-in-net-produces-application-files-myapp-someversionnumber-how-to-ge

The answer was, You have to update both Assembly Version AND File version manually

Shouldn't the version number increment each time I publish? Why should I do it manually? Is this is a conscious decision by MS to do it this way? What's the thinking behind having people manually update their own version number?

patrick
  • 1,028

3 Answers3

9

You could always use the "Build Version Increment" open source add-on for visual studio to do it for you.

...I've tested the addin with Visual Studio 2005/2008 on C#, VB.NET and C++.NET projects under Windows XP/Vista SP1.

Functionality

  • Different auto increment styles can be set per major, minor, build or revision number.
  • Supports C#, VB.NET and C++.NET projects.
  • Not required to be installed by all project members. Configuration is shared via properties in the solution and project files. Developers who don't have the addin won't feel a thing.
  • Automatically checks out required files if under source control.
  • Can be configured per solution and/or per project.
  • Can be configured to update only on certain configuration builds (debug, release, any or custom)
  • Can update assembly attributes in an external source file instead of the default AssemblyInfo...
gnat
  • 20,543
  • 29
  • 115
  • 306
JohnFx
  • 19,040
7

So two or more developers can publish their code under the same version.

JeffO
  • 36,956
1

Visual Studio does update your version number automatically. If you code AssemblyVersion("a.b.*"), every build will get a different number a.b.c.d, and every build number will be greater than all older builds. It just isn't a monotonically-increasing system like most of us expect. Instead, the trailing two components, c.d will be computed based on the current date and time.