I have a program which is distributed via ClickOnce to around 50 PC's. On a handful of these, the version number displays when it is run from the network. However, on most, it is blank.
I have 2 labels. One that simply says "Version", and another that displays the actual number. Neither label is supposed to show if the app is not network deployed. This works...since neither label shows when I run the application from the IDE. However, when running after a network installation, the user will see the "Version" label, but the label with the actual number is left blank.
What makes this even more confusing...on a couple machines, the version number is populated. There is no difference in these machines that I can tell...they all install the app from the same location, etc.
Any ideas?
Code is below.
Expand|Select|Wrap|Line Numbers
- If My.Application.IsNetworkDeployed Then 'If running from the network
- Dim version As String
- version = System.Deployment.Application.ApplicationDeployment.CurrentDeployment.CurrentVersion.ToString
- lblVersion.Text = version
- lblVersion.Visible = True
- lblVersionTitle.Visible = True
- Else 'If running the application locally
- lblVersion.Visible = False
- lblVersionTitle.Visible = False
- Exit Sub
- End If