Solved

Visual Studio Publish Version

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Normally the drop down box control found in the .Net framework tools is able to select just one data and value at a time, which is displayed on the text area.   But what if you want to have multiple values to be selected in the drop down box? As …
It seems a simple enough task, yet I see repeated questions asking how to do it: how to pass data between two forms. In this article, I will show you the different mechanisms available for you to do just that. This article is directed towards the .N…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

706 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now