As David says, these errors go to the application log in the Windows event log.
If you are looking for a little more information at the end of your application, you can subscribe to the UnhandledException event. This way you will get an exception, since your application terminates, and you can check the exception in the debugger, or view the data in the file you selected, etc.
Note: you cannot "handle" the exception in the traditional sense, your application will die. However, it gives you the opportunity to get useful information along your path :)
source share