Inspecting unhandled exceptions – You’ve got only one chance
That’s a surprising behavior, brought to my attention by this question of Anthony Wieser on MSDN forums. Basically, he noticed that in the global exception handler, he could read the stacktrace of the exception only once. On the subsequent tries, the value would be null. The debugging part We’ll start by making a simple program to reproduce the issue. When the user click on a button, we throw a custom exception: In the App.xaml.cs file, we subscribe to the unhandled exception handler, and print twice the stacktrace of the exception: Sure enough, the stacktrace is printed only once. The second time, the property is null. What’sRead More →