samsmithnz Posted July 11, 2005 Posted July 11, 2005 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...? Quote Thanks Sam http://www.samsmith.co.nz
Administrators PlausiblyDamp Posted July 11, 2005 Administrators Posted July 11, 2005 IIRC it is something to do with the date / time the build was performed. Personally I prefer to just set an exact build number anyway - makes it much easier to tie into a version control system. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
samsmithnz Posted July 11, 2005 Author Posted July 11, 2005 That's a really good idea, except, I'm one of those people who always forgets to do that... So I was trying to understand why sometimes it increases and other times it doesn't... Quote Thanks Sam http://www.samsmith.co.nz
penfold69 Posted July 12, 2005 Posted July 12, 2005 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. Quote
mskeel Posted July 12, 2005 Posted July 12, 2005 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... Quote
samsmithnz Posted July 12, 2005 Author Posted July 12, 2005 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.... :) Quote Thanks Sam http://www.samsmith.co.nz
samsmithnz Posted July 12, 2005 Author Posted July 12, 2005 By the Way, I seem have made a mistake posting this here, can an admin please move this to the correct forum? thanks Quote Thanks Sam http://www.samsmith.co.nz
mskeel Posted July 12, 2005 Posted July 12, 2005 I just compiled the same project and also got 2019. A little wierd... I wonder how that relates to "build number"? Quote
samsmithnz Posted July 12, 2005 Author Posted July 12, 2005 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. Quote Thanks Sam http://www.samsmith.co.nz
VBAHole22 Posted August 23, 2006 Posted August 23, 2006 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. Quote Wanna-Be C# Superstar
Leaders snarfblam Posted August 23, 2006 Leaders Posted August 23, 2006 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. Quote [sIGPIC]e[/sIGPIC]
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.