Trying to get the version numbers

itms

Active member
Joined
Feb 21, 2018
Messages
31
Programming Experience
10+
Hi,

When I look in the control panel or in Properties for my Publish version I see 0.3.0.171 (for major, minor, build, and Revision).
However, I want to display this on a form, and I have gotten tons of different codes online and if they work at all give me, v0.2.0.1.
And it never changes that I can see.
I do not know what this is but I need whatever the version os that gives me 0.3.0.171.
Also, we use Oneclick for deployment, if that matters.

Can someone show me how to do this/

Thank you
 

itms

Active member
Joined
Feb 21, 2018
Messages
31
Programming Experience
10+
Hi, and thanks for the reply, but I have tried this and it does not work.
If I have the if statement in there it just bypasses it.
If I take them out I get the following:
System.Deployment.Application.InvalidDeploymentException.

Please tell me what I can do.
Thank you
 

AndyW999

New member
Joined
Jul 24, 2012
Messages
1
Programming Experience
10+
I use -
Function Version() As String
With System.Diagnostics.FileVersionInfo.GetVersionInfo(System.Reflection.Assembly.GetExecutingAssembly.Location)
Return .FileMajorPart & "." & .FileMinorPart & "." & .FileBuildPart & "." & .FilePrivatePart
End With

End Function
 

JohnH

VB.NET Forum Moderator
Staff member
Joined
Dec 17, 2005
Messages
15,439
Location
Norway
Programming Experience
10+
That is not the publish version that OP asked for, that is the file version.
Also, Application.ProductVersion is much easier to use when you want file version, and call .ToString on that to get the string.
 
Top Bottom