Solved

Visual Studio Publish Version

Posted on 2009-07-14
4
891 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
  • 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Summary Displaying images in RichTextBox is a common requirement with limited solutions available. Pasting through clipboard or embedding into RTF content only support static images.  This article describes how to insert Windows control objects int…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

803 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