-
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
-
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.
-
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
-
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.
-
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!