Application.ThreadException for ALL exception? Not just un-trapped ones?
-
30-09-2019 - |
Question
I'm trying to create a top level exception capture for a debug version of some real-time data capture software and was wondering if there was a top-level exception handler similar to Application.ThreadException that captures ALL exceptions, not just unhandled/trapped ones.
Thanks in advance
Solution
If you only want to be notified of all exceptions, you can use the AppDomain.FirstChanceException event.
Note: This is only available in .NET 4.0.
OTHER TIPS
ALL exceptions inherit System.Exception. This would be your top-level that you can trap on.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow