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
  1. Home
  2. General Programming
  3. C#
  4. Access asymbly version

Access asymbly version

Scheduled Pinned Locked Moved C#
announcement
9 Posts 4 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.
  • J Offline
    J Offline
    jashimu
    wrote on last edited by
    #1

    Hi All, I need to display my assembly version on about form. I am not quite sure how get it and display on a label. if know please let me know. thaks,

    M H L 3 Replies Last reply
    0
    • J jashimu

      Hi All, I need to display my assembly version on about form. I am not quite sure how get it and display on a label. if know please let me know. thaks,

      M Offline
      M Offline
      musefan
      wrote on last edited by
      #2

      Google says...

      System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();

      ...you can determine the version of your application in the AssemblyInfo.cs file which may be found in the Properties folder of your solution (VS 2010) EDIT: Slight correction of Google found code

      Illogical thoughts make me ill

      J 1 Reply Last reply
      0
      • J jashimu

        Hi All, I need to display my assembly version on about form. I am not quite sure how get it and display on a label. if know please let me know. thaks,

        H Offline
        H Offline
        Henry Minute
        wrote on last edited by
        #3

        You can get the version for the application with Application.ProductVersion[^]. For an individual assembly you can use something like

        Assembly.GetExecutingAssembly().GetName().Version

        which may, or may not give the same result as the first suggestion.

        Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.” I wouldn't let CG touch my Abacus! When you're wrestling a gorilla, you don't stop when you're tired, you stop when the gorilla is.

        M 1 Reply Last reply
        0
        • J jashimu

          Hi All, I need to display my assembly version on about form. I am not quite sure how get it and display on a label. if know please let me know. thaks,

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          See here[^] for sample code to extract the details.

          I must get a clever new signature for 2011.

          1 Reply Last reply
          0
          • M musefan

            Google says...

            System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();

            ...you can determine the version of your application in the AssemblyInfo.cs file which may be found in the Properties folder of your solution (VS 2010) EDIT: Slight correction of Google found code

            Illogical thoughts make me ill

            J Offline
            J Offline
            jashimu
            wrote on last edited by
            #5

            Thanks for your reply. I already have gotten it, google is the best friends of mine since I started programming. I still don't get it why I am getting asm version 1.0.0.0 where I see is 1.0.7. I have a installer what does it means project and installer will have two different assembly version. thanks,

            M 1 Reply Last reply
            0
            • H Henry Minute

              You can get the version for the application with Application.ProductVersion[^]. For an individual assembly you can use something like

              Assembly.GetExecutingAssembly().GetName().Version

              which may, or may not give the same result as the first suggestion.

              Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.” I wouldn't let CG touch my Abacus! When you're wrestling a gorilla, you don't stop when you're tired, you stop when the gorilla is.

              M Offline
              M Offline
              musefan
              wrote on last edited by
              #6

              The are two version properties in the AssemblyInfo.cs file... AssemblyVersion - which is returned by your second suggestion (code) AssemblyFileVersion - which is returned by your first suggestion (link)

              Illogical thoughts make me ill

              H 1 Reply Last reply
              0
              • M musefan

                The are two version properties in the AssemblyInfo.cs file... AssemblyVersion - which is returned by your second suggestion (code) AssemblyFileVersion - which is returned by your first suggestion (link)

                Illogical thoughts make me ill

                H Offline
                H Offline
                Henry Minute
                wrote on last edited by
                #7

                Which may, or may not be the same, depending on how they have been set.

                Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.” I wouldn't let CG touch my Abacus! When you're wrestling a gorilla, you don't stop when you're tired, you stop when the gorilla is.

                M 1 Reply Last reply
                0
                • J jashimu

                  Thanks for your reply. I already have gotten it, google is the best friends of mine since I started programming. I still don't get it why I am getting asm version 1.0.0.0 where I see is 1.0.7. I have a installer what does it means project and installer will have two different assembly version. thanks,

                  M Offline
                  M Offline
                  musefan
                  wrote on last edited by
                  #8

                  In your solution you will find a file called AssemblyInfo.cs in the properties folder. This file will contain an "AssemblyVersion" property which determines the actual version of the assembly (this will be the value you get if you use my suggested code) I don't use VS for installers but I imagine the installer version is simply there as a sort of "release version" value - i.e. it is up to you to pick this, and would probably make sense for you to set it the same as your assembly version (this paragraph is speculation as I said I do not use VS installer wizard thingy) e.g. you may choose to have the following... Assembly Version = 1.2.3.4 Installer Version = 1.2 (don't need to show the rest is you only ever release minor build changes)

                  Illogical thoughts make me ill

                  1 Reply Last reply
                  0
                  • H Henry Minute

                    Which may, or may not be the same, depending on how they have been set.

                    Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.” I wouldn't let CG touch my Abacus! When you're wrestling a gorilla, you don't stop when you're tired, you stop when the gorilla is.

                    M Offline
                    M Offline
                    musefan
                    wrote on last edited by
                    #9

                    ...Oh I see, that was a statement of knowledge rather than of query

                    Illogical thoughts make me ill

                    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