Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

This question asked how to auto update version number in VS 2010 : http://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?

share|improve this question
add comment

3 Answers

up vote 5 down vote accepted

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

share|improve this answer
    
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
add comment

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.

share|improve this answer
add comment

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...
share|improve this answer
2  
+1 - Nice find! –  Walter Oct 27 '10 at 15:53
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.