?
Solved

Using auto-increment version

Posted on 2008-10-27
9
Medium Priority
?
2,633 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 150 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
Docker-Compose to Simplify Multi-Container Builds

Our veteran DevOps Author takes you through how to build a multi-container environment, managed with a single utility in order to simplify your deployments.

 
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 150 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 450 total points
ID: 22810858
0
 
LVL 8

Author Comment

by:rpkhare
ID: 22810866
Thanks all.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

752 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