Understanding: First Chance exception of type 'Exception Name' occurred in 'dll Name'
Every now and then i read it in the output pane
Si开发者_运维问答mply, Why and when this happens?This will happen if an exception is thrown but then caught. There are some bits of the framework which do this with a depressing frequency... but typically you can ignore it. If it's happening really frequently and you think it may be affecting performance you could always try to work out what's causing it and see if there's anything you can do to stop it - but in my experience it's usually something which happens in perfectly normal situations :(
To see where it's happening, you go to the debugger options and make it break as soon as the exception is thrown - that way you should get a stack trace which will at least show whether it's any of your code directly calling into framework code.
Of course if the DLL is one which is under your control, that's a different matter... then you've got much more chance of working out what's going on :)
Exceptions on windows are thrown twice. The first chance is thrown to notify the debugger. A second chance is thrown to notify exception handlers (like the ones you place inside a catch statement). So like Jon Skeet mentioned if the exception doesn't reach to a second change it means it was caught by the debugger or another component along the way. To understand how this can happen I suggest you read more about structure exception handling and vectored exception handling. See the following articles:
- SEH
- Vectored Exception Handling
Hope that helps
精彩评论