c# - 如何将全局异常处理程序添加到 Metro Style 应用程序?

标签 c# xaml windows-8 windows-runtime

是否有任何特定的方法可以将全局异常处理程序添加到 Metro 风格的应用程序中,就像 App.Xaml.cs 文件中的 WP7 中的 LittleWatson 一样?处理此问题的最佳做法和模式是什么?

最佳答案

UnhandledException event page解释为什么你的异常没有被处理(强调我的):

This event is only used with exceptions encountered by the XAML framework. Exceptions encountered by other Windows Runtime components or parts of the application that are not connected to the XAML framework will not result in this event being raised.

它继续解释说您应该在最具体的时间捕获异常。据我所知,Windows 8 风格的应用程序中没有全局事件处理程序这样的东西。

关于c# - 如何将全局异常处理程序添加到 Metro Style 应用程序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10751745/

相关文章:

windows-phone-8 - 我的系统上未安装 Windows Phone 8.1 模拟器

c# - QR码网络摄像头扫描仪c#

c# - RelayCommand 的重用代码

c# - AudioQueueEnqueueBufferWithParameters 是否在 Monotouch 中实现?

c# - 如何使用 InvokeCommandAction 调用我的方法并传入参数?

c# - 当鼠标悬停在 ScrollViewer 上时,为什么我的 WPF 样式触发器无法仅显示水平滚动条?

windows-8 - Firebreath 插件未在 IE 10 中加载

c# - System.Net.Http.HttpClient 不尊重超时并每次使用默认值

c# - 尝试从 ListBox 对象转换为 MyListBox 时出现 invalidcastException : ListBox object in WPF

windows-8 - winrt 中带水印的密码框