Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
Does anyone understand when each part of the version number increases? I understand the major and minor number are manual, but I don't understand how the revision/build number(s) increase or why. To me... it seems kind of random at the moment. Does it have something to do with me switching from Debug to Release mode...?
Posted

From my interpretation, the build numbers are in the form:

 

Major.Minor.Day.CompileSession

 

So, every different *day* that you compile the code, the third number increments. Every time you close VS, reopen it and compile, the last number increments.

 

B.

Posted

I don't think that's quite right becuase mine always seem to start in the thousands. For example, I just started this project yesterday and got 1.0.2018.27865 as my version. I compiled a handful of times, but certinaly not that many. Plus, I've only owned VS for just under 2 years -- far less than 2018 days.

 

It is a bit of a curiousity. I think my preference would be to have it auto incriment as you build (as the auto generated comments imply). Also, the best would be to have it be automatically tied in to a version control system such as CVS. That would be killer.

 

// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version 
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build Numbers 
// by using the '*' as shown below:

[assembly: AssemblyVersion("1.0.*")]

 

I know I haven't compiled this proejct 2000+ times...

Posted
I think the day thing is correct. But it's not the number of days since you created the project or anything, it's tied into the date. I compiled a couple porjects today, and they are all the day number of 2019. That is very interesting to note. Maybe it's been 2019 days since they released Vs.net or something.... :)
Posted

Here we go:

 

If you specify major and minor, you can specify an asterisk (*) for build. This will cause build to be equal to the number of days since January 1, 2000 local time, and for revision to be equal to the number of seconds since midnight local time, divided by 2.

 

Be careful when relying on version to predict build date in Visual Studio .NET. For some reason, the IDE does not update the build number every time you build a solution. Visual Studio only increments the build and revision number when the solution is closed and reopened. If you build fifty times throughout the day in the same solution, every single one of your builds will have the same version. Close and reopen that solution, though, and you'll get a new version immediately. Go figure.

  • 1 year later...
Posted

How do I go about spitting this assembly information out through code?

I'm trying to get the caption of my win form to display the build information so that when I get screen caps of busted stuff I can see the version

 

I tried

Version vrs = new Version(Application.ProductVersion);
this.Text = "My Tool - Version " + vrs.Major + " - " + vrs.Minor + " - " + vrs.Revision;

 

But I get a number like '9 - 1 - 756'

I get this number every time

and I tried changing the assembly version manually and it still doesn't change.

Wanna-Be C# Superstar
  • Leaders
Posted

The Application.ProductVersion property returns the AssemblyFileVersion attribute (as opposed to AssemblyVersion attribute).

 

I personally really wish that Visual Studio had an option to automatically increment the build number on each build and make an easy way to increment the revision/minor version numbers. Seems like an obvious, simple feature to me.

[sIGPIC]e[/sIGPIC]

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...