1

A small number of our users are experiencing an error when they try to launch our application through ClickOnce. it shows

"Application cannot be started. Contact the application vendor."

Error Box

From reading other solutions on the web, we've figured that clearing the cache either using dfshim or by manually deleting the contents of the cache folder does solve the problem.

Is anyone aware of a general solution we could deploy to the end-user instead of having to clear the ClickOnce cache each time this problem occurs? Does anyone know the root cause of this cache corruption issue?

Jimmy
  • 89,068
  • 17
  • 119
  • 137

2 Answers2

2

Regardless of the version of the .NET Framework that the application targets, install .NET 4 if it is not already installed. The ClickOnce engine is better, and they have improved some of the handling of the cache so this error should happen less frequently.

Another question -- did the user get this after an update was sent out? Or they just got it one day after running the same version for a while?

RobinDotNet
  • 11,723
  • 3
  • 30
  • 33
  • We update fairly frequently -- it is possible that the error is triggered by a new update, but we haven't been able to correlate the timing of the error with the updates since it happens sporadically. What is the implication if it is the updates that are causing the issue? – Jimmy Jun 10 '11 at 17:19
  • If it happens with an update, it could be something that you're inadvertently changing in the deployment properties. If they can run it successfully after an update, but after one or more times it no longer works, then something else is interfering with the ClickOnce cache. – RobinDotNet Jul 07 '11 at 22:58
  • Hi Robin, Thanks for all your help. The problem was that the users were commonly hard-rebooting their machines after an update, causing the registry to be restored from a recent (but not recent enough) backup and the clickonce-related registry entries to become invalid. – Jimmy Jul 08 '11 at 15:01
  • Ah, so it's the "someone else is interfering with the ClickOnce cache" option. ;-) I'm glad you figured out what was going on! – RobinDotNet Jul 11 '11 at 05:08
1

This post suggests using the mage tool

If you want to remove a ClickOnce application, you should use Add/Remove Programs in Control Panel. However, I’ve seen cases where that method just doesn’t work, and you might get “Application cannot be started” message… In this case, you can run Mage.exe –cc command to clear the application cache on that machine. The mage.exe utility comes with .NET Framework SDK… Beware: it will clear the entire application cache, not only for the failing application!

I realize that it doesn't get to root cause, but it's slightly nicer than deleting directories.

Peter K.
  • 8,028
  • 4
  • 48
  • 73