My code:
ProcessInfo processInfo = ...
Process proc = Process.Start(processInfo);
proc.WaitForExit();
if (proc.ExitCode != 0)
{
// ...
}
My problem is that the process (a C++
executable) is sometime crashing due to unhandled exceptions, in unknown circumstances.
I can tell that the executable crashed, since on crash it returns a negative exit code (or non zero for that matter). However, I cannot create a process dump to investigate.
If I at least had Windows' "Program stopped working" message popped, then I could create the dump manually.
Of course I can use software like Debug Diag
to monitor executables and take dump on crash, but would rather have a more generic in-house solution.