0

Hi

i want to display version information on my MDI form text

Below code displays "1.0.0.0" it doesnot display rivision no

Me.Text = System.Windows.Forms.Application.ProductVersion

how can i display version revision ?

thanks

4
Contributors
7
Replies
43
Views
3 Years
Discussion Span
Last Post by Deep Modi
0

still geving Version 1.0.0.0

it should have been 1.0.0.14

0

You can Try this

Me.Text = String.Format("{0}.{1}.{2}.{3}.{4}", My.Application.Info.Version.Major, My.Application.Info.Version.MajorRevision, My.Application.Info.Version.Minor, My.Application.Info.Version.MinorRevision, My.Application.Info.Version.Revision)
0

still result is same.
still geving Version 1.0.0.0

0

You must have to Change the Assembly version of your project. To do that in Project Properties window, go to Application Tab, Click AssemblyInformation button. Now, in this window change the Assembly version as you desire, then Click ‘Ok’ and save it.
In Assembly Information, there are four textboxes.
1. Major version
2. Minor version
3. Build
4. Revision
I am hopeful using following codification you can get your desired result.

Me.Text = String.Format("{0}.{1}.{2}.{3}", My.Application.Info.Version.Major, My.Application.Info.Version.Minor, My.Application.Info.Version.Build, My.Application.Info.Version.Revision)

Edited by Santanu Das

0

ok
its works,i think i will have to change manualy for every publish.

thanks

0

As santanu das describe how to change the assembly information.
then all after you have to add this code in form load event

so when you change assembly version the label will change to that version.

Me.LabelVersion.Text = String.Format("Version {0}", My.Application.Deployment.CurrentVersion.ToString)

when you are adding about form then I find this code, and i use this for my projects.

or you can also use this

me.labelversion.text = My.Application.Info.Version.ToString

or

me.labelversion.text = System.Windows.Forms.Application.ProductVersion.ToString

Edited by Deep Modi

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.