locked
Can't catch all Exceptions RRS feed

  • Question

  • Hi,

    I use Application.ThreadException and AppDomain.CurrentDomain.UnhandledException as a safety net to handle unhandled exceptions in a normal single threaded C# Program in .net 2.0. But some Exceptions are simlpy NOT caught by the two Handlers. And, the program does not crash, they just happen and no one cares. Any ideas?

    Thanks alot, Rainer.
    Tuesday, April 25, 2006 11:29 AM

All replies

  • How do you know that exceptions has happened if they are not caught by your event handlers and does not crash your application?

     

    Tuesday, April 25, 2006 12:33 PM
  • 1.) Because VS 2005 stops there and shows me where the exceptions are thrown and 2.) because I can read it in the Console.
    Tuesday, April 25, 2006 1:14 PM
  • I tried some and it seems as when you are in debug it will run the UnhandledExceptionEventHandler code and then break on the exception. I don't get it so hide any unhandled exceptions.

    If it is a release build it does not even run my UnhandledExceptionEventHandler code but it might be a programming error on my part.

    In C# I don't see that it would be supported to continue after a unhandled exception even with a UnhandledExceptionEventHandler, it looks more like a way to be able to log and exit.

    VB.NET seems to support it, probably for the scenario "On Resume Next"

    Sorry I can not help you further.

    Tuesday, April 25, 2006 7:11 PM