0

I'm using a 3rd party dll written in C# in a WPF application. That dll that I am using, references some unmanaged C++ dlls and I am trying to debug a problem where my application just exits. There are no errors, nothing in my windows event log, so I am assuming something somewhere is making a call to Exit. I want to try and intercept the call to confirm my suspicions, but have not been able to.

I have a callback in App.xaml for the Exit event, but its not firing...

Is there anything else I can do to try and "catch" this exit call?

Zeus82
  • 6,065
  • 9
  • 53
  • 77
  • More probably is the case when an unmanaged dll causes a corrupt state exception, and the whole process gets killed. – dymanoid Feb 20 '15 at 17:45
  • You can try to subscribe to `AppDomain.CurrentDomain.FirstChanceException` event, and then see if there is any exception thrown – RE6 Feb 20 '15 at 17:46
  • You can capture a crash dump and then analyze it. [LocalDumps MSDN](https://msdn.microsoft.com/en-us/library/windows/desktop/bb787181%28v=vs.85%29.aspx) will help you. – Thomas Weller Feb 20 '15 at 17:47
  • @AndroidJoker: would that be better than debugging in Visual Studio? – Thomas Weller Feb 20 '15 at 17:48
  • http://stackoverflow.com/a/13567016/17034 – Hans Passant Feb 20 '15 at 17:54
  • @ThomasW. It would be exactly the same for the case of exception in unmanaged code. `FirstChangeException` will also work without debugging, and generally very useful to log exceptions along with `UnhandledException` event – RE6 Feb 20 '15 at 17:56

0 Answers0