|
-
May 2nd, 2003, 09:14 PM
#1
Thread Starter
Junior Member
Build Number in Version
The full version number consists of a Major Version, Minor Version. Build Number, and a Revision Number.
Is there any way to have the Build Number automatically incremented each time the application is rebuilt?
Right now, the only alternative I am aware of is to manually change the AssemblyVersion in AssemblyInfo.vb
I would prefer an automatic method if one is possible.
Thanks,
Dave
-
May 3rd, 2003, 07:07 AM
#2
Fanatic Member
I'd like to know this also, I haven't stumbled across a way to do this in the docs.
-
May 3rd, 2003, 07:50 AM
#3
Frenzied Member
In the assembly.vb file, in the version section put <1.*.*.*>. (not sure if thats the correct syntax) That should do the trick.
Dont gain the world and lose your soul
-
May 3rd, 2003, 08:46 AM
#4
Fanatic Member
Oh hey, look at that, it's already there. My main project's build information is "1.0.1218.13913". I didn't realize it stuck it into the .EXE. Is there a way to check build number at development, instead of after the build -> File -> Properties -> Version?
-
May 3rd, 2003, 02:38 PM
#5
Thread Starter
Junior Member
I'm already using the syntax of 1.2.*, and that does NOT increment the build number automatically.
Anybody else have any ideas?
Thanks,
Dave
-
May 3rd, 2003, 03:09 PM
#6
Frenzied Member
I think it only does if you have it like this 1.*.*.*. I'll check when I get home.
Dont gain the world and lose your soul
-
May 3rd, 2003, 05:26 PM
#7
Frenzied Member
Ok I tried this
VB Code:
<Assembly: AssemblyVersion("1.1.*")>
and it worked.
BTW I'm using VS.NET 2003, so maybe this was just included.
Dont gain the world and lose your soul
-
May 3rd, 2003, 05:51 PM
#8
Fanatic Member
Works in 2002 also, my app is now version 1.1.1218.30337! Whee!
-
May 3rd, 2003, 07:02 PM
#9
Thread Starter
Junior Member
You seem to be describing a single build. But does this mean that you are really getting incremental changes in the build number?
Rebuild your program again and again. I think you will find that the build number does not get automatically incremented. At least its not for me.
Let me know what you experience.
Dave
-
May 4th, 2003, 02:24 AM
#10
Fanatic Member
What actually makes the version number change on my machine is exiting and restarting the IDE, and then rebuilding. Multiple rebuilds even with profound code changes (commenting out large chunks of code) did not make the version number in the .EXE change, but quit and re-enter the environment and rebuild and the version changes. And by the way the increment isn't 1 for 1 build, it's on some pattern I can't figure out. ^_^
According to the docs:
ms-help://MS.VSCC/MS.MSDNVS/vbcon/html/vbconVersionNumberingChangesInVisualBasicNET.htm
"In Visual Basic .NET, the version number properties are replaced by the AssemblyVersion attribute, which has four parts: Major, Minor, Revision, and Build. For the above example, the resulting version number would be 1.2.3.x, where x is a build number that is incremented each time the assembly is built."
... the above does not seem to be accurate, at least not for me.
-
May 4th, 2003, 06:04 AM
#11
Frenzied Member
Well I just tried this in C# and everytime I build my project my build number changes.
Dont gain the world and lose your soul
-
May 4th, 2003, 12:53 PM
#12
Thread Starter
Junior Member
To Slow_Learner:
There seems to be some discrepancy in the documentation. Contrary to the doc you cited, the AssemblyInfo.vb comments would seem to indicate a different order to the version number, namely Major/Minor/Build/Revision. Note that your documentation switches the order of the last two pieces.
Further, the VB help under Version Class relates the following:
Version numbers consist of two to four components: major, minor, build, and revision. Components major and minor are required. Components build and revision are optional, but the revision component is only optional if the build component is not defined. All defined components must be decimal integers greater than 0. Metadata restricts the major, minor, build, and revision components to a maximum value of MaxValue- 1.
The format of the version number is as follows. Optional components are shown in square brackets ('[' and ']'):
The format of the version number is as follows. Optional components are shown in square brackets ('[' and ']'):
major.minor[.build[.revision]]
So, Slow_Learner, its your revision number that is changing, not the build number. And I agree that it is some unknown increment. Although it seems to be time-related. Early in the day, it has a low number, which is incremented throughout the day. The next morning, it reverts back to a low number again.
-
May 4th, 2003, 04:40 PM
#13
Fanatic Member
This is troubling. I created brand new C# project, and when rebuild (even without modifying) the last set of digits in version information changes. Odd also is that it didn't start out as 1.0.0.0, this was the first version info:
1.0.1219.27678
and again, the numbers do not go up 1 for 1 build.
I created a new VB project, and it behaves differently - version information does not go up even if you delete the ./bin and ./obj directories from your project (to "force" a complete rebuild in case some shortcut was being taken), or if you make substantial code changes. Very strange!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|