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
  • 1
  • 9
  • 23

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
  • 21,442
  • 29
  • 112
  • 288
JohnFx
  • 19,052
  • 8
  • 65
  • 112
7

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

JeffO
  • 36,816
  • 2
  • 57
  • 124
  • Your answer seems to contain serious ambiguity. Shouldn't *different versions* published by different developers have **different** version numbers? – altern Dec 20 '13 at 21:55
  • @altern - what you are saying may be a better practice these days, but that doesn't mean Visual Studio adheres to it. Offering this kind of flexibility gives more control to the dev/dev team. From a release/marketing standpoint, you may want to have everything as of today called 2.0 and not 2.013. – JeffO Dec 22 '13 at 12:46
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.

Ross Patterson
  • 10,277
  • 34
  • 43