Results 1 to 5 of 5

Thread: Application versioning

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2000
    Location
    Dayton, OH USA
    Posts
    119

    Question 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

  2. #2
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    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.
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  3. #3
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649
    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

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Feb 2000
    Location
    Dayton, OH USA
    Posts
    119
    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.

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Feb 2000
    Location
    Dayton, OH USA
    Posts
    119
    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
  •  



Click Here to Expand Forum to Full Width