|
-
Nov 15th, 2001, 09:49 AM
#1
Thread Starter
Lively Member
Application versioning
How do you set the major, minor, build, and revision numbers in VB.NET? Looked all over the place in the IDE and cannot find it. Is this done automagically? Also, when I look at the exe version it is different then the major, minor, build, and revision numbers. Each time I do a build the exe version changes but not the major, minor, build, and revision numbers when doing a:
System.Environment.Version.Major.ToString
System.Environment.Version.Minor.ToString
System.Environment.Version.Build.ToString
System.Environment.Version.Revision.ToString
-
Nov 15th, 2001, 10:31 AM
#2
Perhaps like in VB 6 there is an option somewhere that auto increments the version, but it may be selected by default in .NET. Ill have to look into that.
-
Nov 15th, 2001, 12:18 PM
#3
You can set the version and revision (or build) numbers in the AssemblyInfo.vb file (open it through the Solution Explorer).
Simply change the following row:
Code:
<Assembly: AssemblyVersion("1.0.*")>
The * specifies that it will default the revison number but you may hard code it if you like.
Best regards
-
Nov 15th, 2001, 01:03 PM
#4
Thread Starter
Lively Member
Ok, that is getting closer. When I look at the version on the exe file it says what I specified in the AssemblyInfo.vb file. However when I set a var to System.Environment.Version.ToString I get another set of numbers completely different.
-
Nov 15th, 2001, 01:23 PM
#5
Thread Starter
Lively Member
Got it!
Major: System.Diagnostics.FileVersionInfo.GetVersionInfo(System.Reflection.Assembly.GetExecutingAssembly.Lo cation).FileMajorPart
Minor: System.Diagnostics.FileVersionInfo.GetVersionInfo(System.Reflection.Assembly.GetExecutingAssembly.Lo cation).FileMinorPart
Revision: System.Diagnostics.FileVersionInfo.GetVersionInfo(System.Reflection.Assembly.GetExecutingAssembly.Lo cation).FileBuildPart
Thanks again for everyones help!
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
|