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. Application version help please...

Application version help please...

Scheduled Pinned Locked Moved C#
questioncsharpdebugginghelptutorial
8 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
    JollyMansArt
    wrote on last edited by
    #1

    Ok I have tried several different ways to get this to work but either i am confused at what causes the build version to increment and how to retreive that value at run time. Questions: 1) I want the application to increment it's build version automatically with each compile. How is this possible?       -THe Publish Version I can increment when I compile it in the build menu as publish. But the application goes thru the inhouse setup application with C#. So my first question would be how to increment the build version with each compile. As all my results keep bringing back 1.0.0.0. 2) Once I get the build version to auto increment how do I retrieve that version number. Here is some of what I have tried....                   System.Version version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.;                   //System.Version version = System.Reflection.Assembly.GetExecutingAssembly().                   System.Diagnostics.Debug.WriteLine(String.Format("{0}.{1}.{2}.{3}", version.Major, version.Minor, version.Revision, version.Build));                   //System.Diagnostics.Debug.WriteLine(Application.ProductName.ToString());                   //System.Diagnostics.Debug.WriteLine(Application.ProductVersion.ToString());                   //System.Diagnostics.Debug.WriteLine(Application.CompanyName.ToString());                   //System.Diagnostics.Debug.WriteLine(A                   lblAppVersion.Text = (String.Format("{0}.{1}.{2}.{3}", version.Major, version.Minor, version.Revision, version.Build));                                     System.Version version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.;                   //System.Version version = System.Reflection.Assembly.GetExecutingAssembly().                &nb

    C D M 3 Replies Last reply
    0
    • J JollyMansArt

      Ok I have tried several different ways to get this to work but either i am confused at what causes the build version to increment and how to retreive that value at run time. Questions: 1) I want the application to increment it's build version automatically with each compile. How is this possible?       -THe Publish Version I can increment when I compile it in the build menu as publish. But the application goes thru the inhouse setup application with C#. So my first question would be how to increment the build version with each compile. As all my results keep bringing back 1.0.0.0. 2) Once I get the build version to auto increment how do I retrieve that version number. Here is some of what I have tried....                   System.Version version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.;                   //System.Version version = System.Reflection.Assembly.GetExecutingAssembly().                   System.Diagnostics.Debug.WriteLine(String.Format("{0}.{1}.{2}.{3}", version.Major, version.Minor, version.Revision, version.Build));                   //System.Diagnostics.Debug.WriteLine(Application.ProductName.ToString());                   //System.Diagnostics.Debug.WriteLine(Application.ProductVersion.ToString());                   //System.Diagnostics.Debug.WriteLine(Application.CompanyName.ToString());                   //System.Diagnostics.Debug.WriteLine(A                   lblAppVersion.Text = (String.Format("{0}.{1}.{2}.{3}", version.Major, version.Minor, version.Revision, version.Build));                                     System.Version version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.;                   //System.Version version = System.Reflection.Assembly.GetExecutingAssembly().                &nb

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      1 - the only way I've found to do that, is a post build step that runs an exe that changes the app.config file to increment it 2 - I think what you have should work.

      Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

      J 1 Reply Last reply
      0
      • J JollyMansArt

        Ok I have tried several different ways to get this to work but either i am confused at what causes the build version to increment and how to retreive that value at run time. Questions: 1) I want the application to increment it's build version automatically with each compile. How is this possible?       -THe Publish Version I can increment when I compile it in the build menu as publish. But the application goes thru the inhouse setup application with C#. So my first question would be how to increment the build version with each compile. As all my results keep bringing back 1.0.0.0. 2) Once I get the build version to auto increment how do I retrieve that version number. Here is some of what I have tried....                   System.Version version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.;                   //System.Version version = System.Reflection.Assembly.GetExecutingAssembly().                   System.Diagnostics.Debug.WriteLine(String.Format("{0}.{1}.{2}.{3}", version.Major, version.Minor, version.Revision, version.Build));                   //System.Diagnostics.Debug.WriteLine(Application.ProductName.ToString());                   //System.Diagnostics.Debug.WriteLine(Application.ProductVersion.ToString());                   //System.Diagnostics.Debug.WriteLine(Application.CompanyName.ToString());                   //System.Diagnostics.Debug.WriteLine(A                   lblAppVersion.Text = (String.Format("{0}.{1}.{2}.{3}", version.Major, version.Minor, version.Revision, version.Build));                                     System.Version version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.;                   //System.Version version = System.Reflection.Assembly.GetExecutingAssembly().                &nb

        D Offline
        D Offline
        Dougie the P
        wrote on last edited by
        #3

        Just to be clear you want the publish version that is stored in the manifest from the publish page in project properties. versus the assembly version from the assembly information sub form on the application page. all the code you have tried the results come from the assembly information.

        J 1 Reply Last reply
        0
        • C Christian Graus

          1 - the only way I've found to do that, is a post build step that runs an exe that changes the app.config file to increment it 2 - I think what you have should work.

          Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

          J Offline
          J Offline
          JollyMansArt
          wrote on last edited by
          #4

          This would be what I am trying to accomplish. Any suggestions on a exe that does this or do you have a sample blueprint one so I don't have to invent the wheel? thanks. So Essentially I will need to manually make sure the build version is set before compiling. Correct.

          1 Reply Last reply
          0
          • J JollyMansArt

            Ok I have tried several different ways to get this to work but either i am confused at what causes the build version to increment and how to retreive that value at run time. Questions: 1) I want the application to increment it's build version automatically with each compile. How is this possible?       -THe Publish Version I can increment when I compile it in the build menu as publish. But the application goes thru the inhouse setup application with C#. So my first question would be how to increment the build version with each compile. As all my results keep bringing back 1.0.0.0. 2) Once I get the build version to auto increment how do I retrieve that version number. Here is some of what I have tried....                   System.Version version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.;                   //System.Version version = System.Reflection.Assembly.GetExecutingAssembly().                   System.Diagnostics.Debug.WriteLine(String.Format("{0}.{1}.{2}.{3}", version.Major, version.Minor, version.Revision, version.Build));                   //System.Diagnostics.Debug.WriteLine(Application.ProductName.ToString());                   //System.Diagnostics.Debug.WriteLine(Application.ProductVersion.ToString());                   //System.Diagnostics.Debug.WriteLine(Application.CompanyName.ToString());                   //System.Diagnostics.Debug.WriteLine(A                   lblAppVersion.Text = (String.Format("{0}.{1}.{2}.{3}", version.Major, version.Minor, version.Revision, version.Build));                                     System.Version version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.;                   //System.Version version = System.Reflection.Assembly.GetExecutingAssembly().                &nb

            M Offline
            M Offline
            mustang86
            wrote on last edited by
            #5

            <1) I want the application to increment it's build version automatically with each compile. How is this possible? -THe Publish Version I can increment when I compile it in the build menu as publish. But the application goes thru the inhouse setup application with C#. So my first question would be how to increment the build version with each compile. As all my results keep bringing back 1.0.0.0.

            Check out: http://autobuildversion.codeplex.com/[^]

            J 1 Reply Last reply
            0
            • D Dougie the P

              Just to be clear you want the publish version that is stored in the manifest from the publish page in project properties. versus the assembly version from the assembly information sub form on the application page. all the code you have tried the results come from the assembly information.

              J Offline
              J Offline
              JollyMansArt
              wrote on last edited by
              #6

              I want the value that identifies the exe's version for the application. But I want the exe's version to increment each time it compiles so that when the application is running live I can identify if the end user is using the most current version released. And if not to know what specific build version they have.

              1 Reply Last reply
              0
              • M mustang86

                <1) I want the application to increment it's build version automatically with each compile. How is this possible? -THe Publish Version I can increment when I compile it in the build menu as publish. But the application goes thru the inhouse setup application with C#. So my first question would be how to increment the build version with each compile. As all my results keep bringing back 1.0.0.0.

                Check out: http://autobuildversion.codeplex.com/[^]

                J Offline
                J Offline
                JollyMansArt
                wrote on last edited by
                #7

                Perfect thanks. :)

                M 1 Reply Last reply
                0
                • J JollyMansArt

                  Perfect thanks. :)

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

                  Glad to help! :) I agree, it's a feature that's badly missing in Visual Studio 2008. I also modified a C# backup zip program that I found to do a backup of my current project with the date and time appended to the zip file. For under $100, you can get 1TB of external storage. So, IMHO, there is no reason at all not to save TONS of versions! Good Luck!

                  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