On the publish tab of My Project the correct current version is there, 1.1.0.0 and in Programs and Features under Control Panel it shows 1.1.0.0 but when I reference Application.ProductVersion I get 1.0.0.0.
What am I doing wrong or what am I missing here?
Thanks.
The assemby version (in the application.config file) and the ClickOnce Publish version are 2 seperate numbers.
If you want to get the ClickOnce version at runtime you can use the following code
If (System.Deployment.Application.ApplicationDeployment.IsNetworkDeployed) Then
With System.Deployment.Application.ApplicationDeployment.CurrentDeployment.CurrentVersion
Me.Text = "V" & .Major & "." & .Minor & "." & .Build
End With
End If
Edit: For the full, four-segment revision number you'll need:
Me.Text = "V" & .Major & "." & .Minor & "." & .Build & "." & .Revision
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With