Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Understanding: First Chance exception of type 'Exception Name' occurred in 'dll Name'

Tags:

c#

exception

Every now and then i read it in the output pane
Simply, Why and when this happens?

like image 472
Rami Alshareef Avatar asked Dec 19 '10 09:12

Rami Alshareef


1 Answers

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 :)

like image 134
Jon Skeet Avatar answered Nov 03 '22 00:11

Jon Skeet