tags:

views:

179

answers:

4

Wondered if this has ever happened to anyone out there. I have a WPF application that I publish using ClickOnce.

When the ClickOnce link is reached I click "Run" and the app is installed on my machine. However, when I click the application from the start menu, it checks for updates, then does nothing.

Am I missing a setting?

+1  A: 

It sounds like you the application is exiting on it's own after startup. Either by means of explicitly exiting or because of an unhanded exception.

Have you tried attaching a debugger and seeing what is happening?

JaredPar
How can I debug this? What process am I attaching the debugger to? If I can do this that would definitely be helpful!
Mark Kadlec
@Mark K, I'm not entirely sure what the process name will be. Usually I just keep task manager up and see what the name of the process is and then attach to that next launch.
JaredPar
That's going to be tough. I just launched the app with Task manager open and it closes so quickly that I can't see which process. Are there any other ways to debug this?
Mark Kadlec
+1  A: 

There's a few things you do.

To check whether there is an unhandled exception you can:

  1. Attach a Dispatcher Exception Handler on your System.Windows.Application object.
  2. Listen to the UnhandledException event on the AppDomain.

In these you can catch any unhandled exceptions, log them and figure things out.

Another technique that we use to attach a debugger is that we have a piece of code in our initialization logic that says that if the CTRL key is pressed, a little message box pops up before anything occurs in the app with the text "starting up". This is our chance to attach a debugger and figure things out.

siz
+1  A: 
  1. Put a call to System.Diagnostics.Debugger.Break(); in Main()

  2. run with click once from your Website, just step over the breat point when you hit it then exit your app

  3. start your app from start menu

  4. debug it when you break point is hit (windows will ask if you wish to debug the app)

Ian Ringrose
A: 

There is a known problem of this happening when the user has a Kensington mouse, or at least the Kensington mouse software installed.

RobinDotNet