0

I have a client experiencing our program closing with no error, nothing in Windows Event log, and need to find out why it's happening.

I've added event handlers for both ProcessExit and ApplicationExit, but neither get triggered:

AppDomain.CurrentDomain.ProcessExit += new EventHandler(OnApplicationExit);
Application.ApplicationExit         += new EventHandler(OnApplicationExit);

This says to me the process is being terminated 'rudely' (apparently this is a term) by some part of the OS. Is there anyway I can figure out what is doing that?

baddie
  • 437
  • 5
  • 13
  • What information/error do you get in the event handlers when your application is terminated? – Dipen Shah Jul 31 '18 at 20:52
  • 1
    ProcessExit and ApplicationExit won't get triggered since your application is not exiting in a normal way. Look at [this stackoverflow thread](https://stackoverflow.com/questions/5762526/how-can-i-make-something-that-catches-all-unhandled-exceptions-in-a-winforms-a) to see how to catch unhandled exception in winform applications. – Nish26 Aug 01 '18 at 04:41
  • @dipen The event handlers don't get called. – baddie Aug 01 '18 at 21:52

0 Answers0