3

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"

Community
  • 1
  • 1
user1725145
  • 3,993
  • 2
  • 37
  • 58
  • Without more context, this sounds impossible to answer. What is the specific meaning of "crashes" here? what is the exception? did you catch the exception? if so: where? was it perhaps on a worker thread? details... – Marc Gravell Mar 19 '13 at 11:17
  • Do you have any code, specifically for error handling? What exception is thrown? Have you stopped through the code, or tried anything else? – Austin T French Mar 19 '13 at 11:17
  • I have added some more to the question, which I hope will clarify what I am asking, and what I am not asking. Thanks. – user1725145 Mar 19 '13 at 11:22
  • 1
    Maybe there are multiple exceptions in progress and the second chance is on another thread. Have you inspected all the thread stacks? `~*kb` should do it. – Marc Sherman Mar 19 '13 at 13:21
  • How do you find out that it's a first chance exception? Can you please post the output of WinDbg? – Thomas Weller Mar 22 '17 at 10:52

0 Answers0