Publish version number

  • Thread starter Thread starter Dean Slindee
  • Start date Start date
D

Dean Slindee

How do you get the publish version number from the application Settings
Publish tab in VB?

Something along these lines (does not work):
If (System.Deployment.Application.ApplicationDeployment.IsNetworkDeployed)
Then

Dim ad As System.Deployment.Internal.InternalApplicationIdentityHelper =
System.Deployment.Application.ApplicationDeployment.CurrentDeployment

Me.Text = ad.CurrentVersion.ToString()

End If



Thanks,

Dean S
 
Dean,

Can't you just do something like?
MessageBox.Show(Application.ProductVersion.ToString)
 
Dean,

You can retrieve the "publish version" number from the Project Settings using this:

If (System.Deployment.Application.ApplicationDeployment.IsNetworkDeployed) Then
Dim verDeployed As System.Version = My.Application.Deployment.CurrentVersion
End If
 
To display published(network deployed) or assembly version:

' test if network deployed
Dim verDeployed As System.Version
Dim strVerDeployed As String
If (System.Deployment.Application.ApplicationDeployment.IsNetworkDeployed) Then
verdeployed = My.Application.Deployment.CurrentVersion
strVerDeployed = verDeployed.ToString
Else ' or if command line execution
Dim asmThis As System.Reflection.Assembly = System.Reflection.Assembly.Load("CADView")
Dim asnThis As System.Reflection.AssemblyName = asmThis.GetName()
verDeployed = asnThis.Version
strVerDeployed = verDeployed.ToString
End If
Me.Text = My.Settings.CompanyName & " " & My.Settings.WindowTitle & " v." & strVerDeployed
 
Back
Top