Solved

Using auto-increment version

Posted on 2008-10-27
9
2,628 Views
Last Modified: 2012-05-05
In my project settings I have enabled "Automatically increment version revision" (See the attached image). I want to know how to display the latest version information on my Form's caption. Where this automatically revised version details are stored and how to use them?
0
Comment
Question by:rpkhare
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
  • 2
  • +1
9 Comments
 
LVL 53

Expert Comment

by:Dhaest
ID: 22810636
This C# code snippet displays the version number of the specified component.


using System;
using System.Reflection;
 
public class VersionNumber
{
   public static void Main()
   {
      Type type = Type.GetType ("System.Int32");
      Assembly assembly = Assembly.GetAssembly (type);
      AssemblyName assemblyName = assembly.GetName();
      Version version = assemblyName.Version;
      Console.WriteLine ("Version: {0}", version);
      Console.WriteLine ("Major: {0}", version.Major);
      Console.WriteLine ("Minor: {0}", version.Minor);
      Console.WriteLine ("Build: {0}", version.Build);
      Console.WriteLine ("Revision: {0}", version.Revision);
      Console.Read();
   }
}

Open in new window

0
 
LVL 8

Author Comment

by:rpkhare
ID: 22810650
How to make sure that it is incrementing. Sorry I missed the image in my original post. Attached below.
publish.JPG
0
 
LVL 16

Assisted Solution

by:ororiole
ororiole earned 50 total points
ID: 22810667
You can also get the assembly version this way, for example putting it in a textbox.
textBox2.Text = Application.ProductVersion;

It is only incremented when you publish your application. It will not should an increment with each build.
It will show up in the publish tab as you have displayed. You can also look in your Properties folder, AssemblyInfo.cs
0
Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

 
LVL 8

Author Comment

by:rpkhare
ID: 22810685
But it is a Windows based desktop application. What will Publish do and where it will Publish my application. I want it to be increment on each successful build.
0
 
LVL 47

Expert Comment

by:Wayne Taylor (webtubbs)
ID: 22810748
Hi rpkhare,

The version you're showing here is the Publish version, not the application version. The Publish version let's the application know when a new update is available.

See here for more info on the Publish Version and ClickOnce....

http://msdn.microsoft.com/en-us/library/e6y518tc.aspx
http://msdn.microsoft.com/en-us/library/142dbbz4.aspx

Regards,

Wayne
0
 
LVL 8

Author Comment

by:rpkhare
ID: 22810756
Why the Application version is not available in my purchased copy of Visual Studio Professional 2005?
0
 
LVL 47

Assisted Solution

by:Wayne Taylor (webtubbs)
Wayne Taylor (webtubbs) earned 50 total points
ID: 22810780
It is available. In the Application tab of your projects properties, click "Assembly Information" and enter your File version here. Then you can access it as ororiole stated in http:#a22810667

Wayne
0
 
LVL 53

Accepted Solution

by:
Dhaest earned 150 total points
ID: 22810858
0
 
LVL 8

Author Comment

by:rpkhare
ID: 22810866
Thanks all.
0

Featured Post

Is Your DevOps Pipeline Leaking?

Is your CI/CD pipeline a hodge-podge of randomly connected tools? You’ve likely got a tool to fix one problem & then a different tool to fix another, resulting in a cluster of tools with overlapping functionality. Learn how to optimize your pipeline with Gartner's recommendations

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question