问题
Probably this is a normal situation, but I am confused.
I am running my C# Debug application from Visual Studio. DebugDiag is set up to attach to the process automatically.
I have a rule to collect crash dumps from this application, and the rule defines that the action for unconfigured first chance exceptions should be "none".
But when the application crashes, and when I look at the dump files it says that there is a first chance exception.
From the answer to this SO question, I understand that "exceptions are thrown to the debugger first and then to the actual program where if it isn't handled it gets thrown to the debugger a second time"
So why does DebugDiag collect dump files for the first chance exception?
EDIT Just to be clear, I am not trying to fix broken code here. I'm trying to understand why DebugDiag told me that a first chance exception had made my code crash. Surely by definition, only a 2nd chance exception can make code crash, i.e. one that has NOT been handled by the code?
"crash" means that the process terminated and DebugDiag generated crash dump files. I was running the Debug version of the code on "Start without Debugging"
来源:https://stackoverflow.com/questions/15497932/program-crashes-but-debug-diag-says-its-a-first-chance-exception-is-that-corr