I'm using Spring.NET with Caliburn 2 and getting some exceptions from these frameworks at runtime (e.g. NoSuchObjectDefinitionException and UnsatisfiedDependencyException in Spring.NET, NullReferenceException in Caliburn).
These exceptions are being raised after my App.xaml.cs InitializeComponent() method has finished, meaning (as far as I am aware) there is no line in my code specifically causing the error, and therefore nothing to wrap in a try-catch. Almost certainly I've misconfigured Spring or Caliburn somewhere, but I would really like whatever clues these exceptions contain in order to figure it out.
Is there some way to catch and inspect exceptions generated from third-party framework code at runtime?
You can the use
Application.DispatcherUnhandledException
AppDomain.CurrentDomain.UnhandledException
events.
This should catch all exceptions you can't wrap with try/catch yourself.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With