Program crashes, but Debug Diag says it's a first chance exception, is that correct?

杀马特。学长 韩版系。学妹 提交于 2019-12-14 01:19:51

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!