Reading the actual vb.net project published build #

  • Thread starter Thread starter barcrofter
  • Start date Start date
B

barcrofter

This seems like a silly question -- How can I read the actual publish
version build data??.

When I use:

With My.Application.Info
Version.Text = "Version: " _
+ Format(.Version.Major + .Version.Minor / 10
+ .Version.Build / 100, "0.00")
End With

All I get is Version: 1.0 even though the actual publish is
1.1.150??? Minor and build are both 0
 
I found the following post from an Andrej Tozon in 2006: (full context:
http://social.msdn.microsoft.com/forums/en-US/vblanguage/thread/2da15d47-1b27-4535-ae34-b623db6ba87b)


The version you're currently displaying is not the published version, but an
application (assembly) version. Those version numbers aren't the same and
are not synchronized. To use the published version, use
My.Application.Deployment.CurrentVersion:

If My.Application.IsNetworkDeployed Then
lblLabel.Text = My.Application.Deployment.CurrentVersion.ToString()
End If

Note the if statement above: the Deployment.CurrentVersion is only available
when the application is deployed with ClickOnce, which means it won't be
available when deployed otherwise or run within Visual Studio, when
debugging (accessing it will throw an exception).



My.Application.Info.Version.ToString

ok My.Application.Info.Version.ToString reads 1.0.0.0 which is the
problem.

is this a feature of the express edition?
 
Back
Top