If my application ends with an exception that I cannot handle, I want it to display an error message to the user and leave. The problem is that the user is shown a dialog with exceptions with the details, Continue, and Exit options, and if the user clicks Continue, the application remains in a βstateβ that I do not want.
To replicate this with the least amount of code, I just created a Windows Forms application, added a button, and for the button click code I just wrote:
throw new ApplicationException("I must crash now!!!");
When I run the compiled exe from the Debug folder, the Release folder or run exe from the Release folder copied somewhere else (in case the pdb file causes a problem) and clicking on the button, I will be shown the details / Continue / Quit, and if I will say that the application remains alive. How can I prevent the continuation option from appearing?
I have this behavior on my computer (Vista, Visual Studio 2008, Visual Studio 2010, creating a test application with VS2010), as well as on a user computer (Windows 7).
source
share