Global handling exception in WPF app with Caliburn.Micro

前端 未结 1 1849
小蘑菇
小蘑菇 2020-12-18 04:51

Hi I try implement solution from this site im my WPF app for global exception handling.

http://www.codeproject.com/Articles/90866/Unhandled-Exception-Handler-For-WPF

1条回答
  •  时光说笑
    2020-12-18 05:24

    Caliburn.Micro has built in support for hooking unhandled exceptions. The Bootstrapper class (which every Caliburn project requires) sets this up for you and provides the virtual OnUnhandledException method.

    In your custom BootStrapper you must override OnUnhandledException to perform any custom actions for unhandled exceptions in your app. Note that you will most likely have to marshal actions such as displaying a message box to the UI thread (Caliburn enables this easily via Execute.OnUIThread).

    You may also have an issue in the way your service moves exceptions to the client, but without any details of how the service is implemented/hosted/etc I cannot help. Are you using WCF to do SOAP? Are you using FaultContracts?

    0 讨论(0)
提交回复
热议问题