I observe very strange exception handling behavior in any Windows 8.1 (WinRT) application. I've created default project "Blank App (Windows 8.1)", declared MyException exception class and throw it in button's click event handler. I have submitted to Application.UnhandledException event and trying to get the type of received exception. Sometimes it is my exception, sometimes it is common System.Exception. Sometimes debugger shows it is common Exception but application works as it would be MyException: Question is "How to make a WinRT application to work the same way as .NET application in context of exceptions, and as it is declared by winRT documentation? I want to receive exception object that I have thrown".
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
- How to know full paths to DLL's from .csproj f
I should save UnhandledExceptionEventArgs.Exception value to a variable before reading any properties of UnhandledExceptionEventArgs class. After that you can access any information (like stack trace) at any moment by reading your variable value(not UnhandledExceptionEventArgs.Exception value). That behavior seems to be an issue so I reported it: https://connect.microsoft.com/VisualStudio/feedback/details/3134547/windows-rt-8-1-unhandledexceptioneventargs-issue