Runtime exception throws in IoC container

I use Spring.NET with Caliburn 2 and get some exceptions from these frameworks at runtime (e.g. NoSuchObjectDefinitionException and UnsatisfiedDependencyException in Spring.NET, NullReferenceException in Caliber).

These exceptions occur after my App.xaml.cs InitializeComponent () method has completed, which means (as far as I know), there is no line in my code that causes an error, and so try to catch nothing to wrap. Almost certainly I misconfigured Spring or Caliburn somewhere, but I would really like all of these exceptions to be included in order to understand this.

Is there a way to catch and check exceptions thrown from third-party runtime code?

+5
source share
1 answer

you can use

Application.DispatcherUnhandledException
AppDomain.CurrentDomain.UnhandledException

events.

This should cover all exceptions that you cannot wrap with try / catch.

+4
source

All Articles