Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Visual Studio Publish Version

Posted on 2009-07-14
4
Medium Priority
?
909 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 2000 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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
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…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

636 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