在WPF应用程序中处理所有异常的最佳实践是什么? [英] What is best practice to handle all Exceptions in WPF application?

查看:72
本文介绍了在WPF应用程序中处理所有异常的最佳实践是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么方法可以处理WPF应用程序中的所有错误异常和崩溃?

Is there any way to handle all Errors Exceptions and crashes in WPF application?

我知道 DispatcherUnhandledException ,但是它仅处理UI线程中的异常,不是吗?

I know about DispatcherUnhandledException, but it handles only exceptions in UI thread, doesn't it?

有没有办法捕获并记录其他线程中的所有异常以及绑定错误?

Is there a way to catch and log all exceptions in other threads and binding errors too?

推荐答案

请记住,Microsoft不建议捕获所有异常,而是建议仅捕获您知道(或期望)的异常发生在某个地方)。如果要获得 Certified for Microsoft [Windows | Vista]徽标徽标,甚至不能捕获未知的异常,并且此类异常必须转到 Wer

Keep in mind, that Microsoft does not recommend catching all exceptions, instead they recommend to catch only exceptions you know (or expect to happen in some place). Even more if you want to get "Certified for Microsoft [Windows|Vista]" logo, you must not catch unknown exceptions, and such exceptions must go to Wer.

这篇关于在WPF应用程序中处理所有异常的最佳实践是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆