0

I have a console application that will crash as soon as it is started, but display some very useful information (for my debugging) before it terminates.

I used to launch this application on Windows 8.1, where a message box with the error message "... has stopped working" would appear. The console window would remain open for me to read the console output until I clicked "Close the program" in the error message box.

I am now migrating to Windows 10. Unfortunately, Windows 10 does not display the "... has stopped working" message box. Instead, it closes the console automatically as soon as the application has crashed.

I am seeing the same phenomenon on my contacts' Windows 10 machines, although I am also being told about one Windows 10 machine where the error message box still gets shown.

Is there any way to force Windows 10 to show the message box (globally, or just for that one application) again?

I have tried various workarounds, but they all come with drawbacks:

  • If I launch the console application from a console window (cmd), it will still open an additional console window, thus my console window remains blank. (Maybe this is linked to the application in question requiring elevated permissions and asking for these upon launch?)
  • Doing the same and piping the output to a file just produces a blank file.
  • I can modify the source code of the console application in question to wait for some input in the end, but it's a change that I must do only in my local working copy, and it means I have to rebuild said application on a daily basis (as my local binary will otherwise be overwritten by the latest version from a build server).
  • I can find the same output in the Windows event log, but that's quite a tedious alternative, given that the event log viewer is a pretty slow application and it tends to bury the relevant data among thousands of other uninteresting log entries.
  • 2
    Aside from fixing the issue, anytime this happens an eventlog entry is always made, so you can always read the text there. – LPChip Jan 7 at 13:38
  • ... has stopped working message is still displayed on Windows 10 when applicable, so if it's not happening, then the error is caused by something that prevents it. ... has stopped working should only happen when Windows believes the executable is hung, if the application is crashing with an unhandled exception, the message wouldn't be displayed on any version of Windows. If your program requires elevated permissions on Windows 10, and it didn't on Windows 8, that sounds like a configuration difference between the two installations. – Ramhound Jan 7 at 13:40
  • @LPChip: Right, forgot about that alternative. I mentioned it in an additional item at the end now, thanks. – O. R. Mapper Jan 7 at 13:44
  • @Ramhound: The program requires elevated permissions on both Windows 8 and 10. "if the application is crashing with an unhandled exception, the message wouldn't be displayed on any version of Windows" - I cannot tell whether this is true or false. I just see that the application invariably (on both Windows 8 and 10) crashes with an unhandled ReflectionTypeLoadException, whereupon on Win8, the "... has stopped working" message appears, while it does not on Win10. – O. R. Mapper Jan 7 at 13:48
  • 1
    "tends to bury the relevant data among thousands of other uninteresting log entries." Leave event viewer open (use refresh when needed), you can filter or search by event number also, its not tedious. – Moab Jan 7 at 13:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.