Let’s say I have a .NET application that crashes when I close it and I want to use DebugDiag to see what is going on. So we should create a dump file. My question is When do we create this dump file? Should I create it when I start the application? well if I do that it says a dump file has been created at this temp location…ok..then I continue working the application and make it to crash, but my confusion is that well it created the dump file very early, but crash happened at the end, so how even that dump file can be helpful? does it like get updated automatically once we are working with that application?
Share
For a crash (which is usually an unhandled exception) you should create the dump file when the exception becomes a second chance exception. I am not very familiar with DebugDiag, but tools such as adplus (Debugging Tools for Windows) and ProcDump will both let you create dumps for this.
In some cases you may want to create dumps for first chance exceptions as well (i.e. before any code gets to handle the exception). E.g. if the exception which causes the crash wraps some other exception you may not have enough information at that point. In those cases creating dump files on first chance exceptions will give you detailed information on the state of the original exception.