Link to home
Start Free TrialLog in
Avatar of schwientekd
schwientekdFlag for United States of America

asked on

Visual Studio Publish Version

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

Avatar of dericstone
dericstone
Flag of Germany image

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?
Avatar of schwientekd

ASKER

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?
ASKER CERTIFIED SOLUTION
Avatar of dericstone
dericstone
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
That worked, thanks!