1

I have a ClickOnce winforms application which I am debugging in the VS2010 IDE. I have a catch-all unhandled exception handler which also gives the user the option to restart execution. Calling Application.Restart() works fine, but when debugging, it restarts detached from the debugger.

Is there a way to make VS automatically attach it when it restarts? If so, how? If not, why not?

Styxxy
  • 7,462
  • 3
  • 40
  • 45
djv
  • 15,168
  • 7
  • 48
  • 72
  • By design. The point of using a debugger is to ensure that this catch-all handler will never run. – Hans Passant Nov 01 '12 at 13:56
  • Do you mean I should utilize my debugger to "de-bug" my code so I don't have unhandled exceptions? – djv Nov 01 '12 at 14:55

1 Answers1

0

Based upon my previous review of Application.Restart here it does not do anything special when starting the application again, so you just have to make sure Visual Studio is configured to debug "child" processes. (This may not be an option for managed debugging.)

Community
  • 1
  • 1
Mark Hurd
  • 10,665
  • 10
  • 68
  • 101