By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,543 Members | 2,037 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,543 IT Pros & Developers. It's quick & easy.

ClickOnce "Application.IsNetworkDeployed" problem

P: 11
I'm having a problem displaying the version number of the ClickOnce deployment on my programs, but it's under odd conditions...

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
  1.         If My.Application.IsNetworkDeployed Then 'If running from the network
  2.             Dim version As String
  3.             version = System.Deployment.Application.ApplicationDeployment.CurrentDeployment.CurrentVersion.ToString
  4.             lblVersion.Text = version
  5.             lblVersion.Visible = True
  6.             lblVersionTitle.Visible = True
  7.         Else 'If running the application locally
  8.             lblVersion.Visible = False
  9.             lblVersionTitle.Visible = False
  10.             Exit Sub
  11.         End If
  12.  
May 10 '07 #1
Share this Question
Share on Google+
3 Replies


Motoma
Expert 2.5K+
P: 3,235
I would suggest building in a debug mode that will give you an interface to pull data from your system. Perhaps build a debug console which will let you dump and query your state variables and see what exactly is going on.
May 10 '07 #2

P: 11
How would I go about doing this with a network deployment, though? If I push out a different version of the app, it will be installed for all users when they restart it.
May 10 '07 #3

Motoma
Expert 2.5K+
P: 3,235
Create it as a different Project? A new application?
May 10 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.