Application.ThreadException vs AppDomain.UnhandledException

前端 未结 3 1633
谎友^
谎友^ 2020-12-31 10:10

First some background: I have a multi-threaded WinForms application that is doing interop to native dlls. This application crashes sometimes with unhandled exception and we

3条回答
  •  梦谈多话
    2020-12-31 10:49

    Application.ThreadException will only be raised for unhandled exceptions on WinForms UI threads (see here.) Adding a handler for AppDomain.UnhandledException could help in this case (though with some caveats, as described in the remarks section here.)

提交回复
热议问题