Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. HowTo: get version number?

HowTo: get version number?

Scheduled Pinned Locked Moved C#
tutorialquestionannouncement
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Ariadne
    wrote on last edited by
    #1

    Hi if I publish a version there is a version number, which increments each publish circle. I'd like to show this number in an info-box. But how to get it? (it ist not the Application.ProductVersion. This vesion is the number of the AssemblyInfo.cs) Thanks

    Ariadne

    R 1 Reply Last reply
    0
    • A Ariadne

      Hi if I publish a version there is a version number, which increments each publish circle. I'd like to show this number in an info-box. But how to get it? (it ist not the Application.ProductVersion. This vesion is the number of the AssemblyInfo.cs) Thanks

      Ariadne

      R Offline
      R Offline
      Russell Jones
      wrote on last edited by
      #2

      Hi ariadne, Is this the version number you are looking for? Assembly thisAssembly = Assembly.GetExecutingAssembly(); Console.WriteLine(thisAssembly.GetName().Version); needs using System.Reflection; HTH Russ

      A E 2 Replies Last reply
      0
      • R Russell Jones

        Hi ariadne, Is this the version number you are looking for? Assembly thisAssembly = Assembly.GetExecutingAssembly(); Console.WriteLine(thisAssembly.GetName().Version); needs using System.Reflection; HTH Russ

        A Offline
        A Offline
        Ariadne
        wrote on last edited by
        #3

        No, sorry, it delivers the same as Application.ProductVersion. I need the Revison# from the published version.:(

        Ariadne

        1 Reply Last reply
        0
        • R Russell Jones

          Hi ariadne, Is this the version number you are looking for? Assembly thisAssembly = Assembly.GetExecutingAssembly(); Console.WriteLine(thisAssembly.GetName().Version); needs using System.Reflection; HTH Russ

          E Offline
          E Offline
          ednrgc
          wrote on last edited by
          #4

          Remove the .Version from the second line, and check all the methods. They are all there.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups