Application version help please...
-
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
-
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
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.
-
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
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.
-
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.
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.
-
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
<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/[^]
-
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.
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) 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/[^]
Perfect thanks. :)
-
Perfect thanks. :)
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!