Solved

Visual Studio Publish Version

Posted on 2009-07-14
4
893 Views
Last Modified: 2013-11-26
I am trying to show the published version of my application on a label in my windows forms project.  I want to to show Major.Minor.Build.Revision but I cannot figure out how to make this work.  I've got a label on the application splash screen and I've set it's text property to Version {0}.{1:00}.{2}.{3}.  In the FormLoad event I have added the code listed below.  The label shows "Version 1.00.0.0" when it shold show a number for Revision "Version 1.00.0.27".  What am I missing here?
Version.Text = System.String.Format(Version.Text, My.Application.Info.Version.Major, My.Application.Info.Version.Minor, My.Application.Info.Version.Build, My.Application.Info.Version.Revision)

Open in new window

0
Comment
Question by:schwientekd
[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
  • 2
  • 2
4 Comments
 
LVL 8

Expert Comment

by:dericstone
ID: 24853444
Why do you expect 1.00.0.27? Where do you find that version? The AssemblyVersion is different than the AssemblyFileVersion -- could that be your problem?
0
 

Author Comment

by:schwientekd
ID: 24859231
I see the 1.0.0.27 when I view the properties of my project in Visual Studio 2008.  On the Publish tab there is a section called Publish Version.  This is set to automatically increment each time I publish the application.  I did a search about AssemblyVersion and AssemblyFileVersion and found that I could manually change this number in the AssemblyInfo.vb file.  Do you know of a way to automate this as opposed to checking which version it is at and manually updating it in the assembly.vb file?
0
 
LVL 8

Accepted Solution

by:
dericstone earned 500 total points
ID: 24863593
The publish version can be found in My.Application.Deployment.CurrentVersion. You should be able to use the method you had before. Sorry for sending you on the wrong track.
0
 

Author Closing Comment

by:schwientekd
ID: 31603381
That worked, thanks!
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Latest thoughts on C# utilizing Mono on Linux vs .NET on Windows? 5 90
Function after success of Jquery/AJAX action 9 42
jquery tab header text 1 28
C# XML Get Values 4 33
Flash (http://en.wikipedia.org/wiki/Adobe_Flash) has evolved over the years to where it has become a masterful tool for displaying content screen.  It has excellent layout placement, UI precision as well as rendering capabilities. This, along with t…
Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

735 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