Debugging with 2010

learning

Active member
Joined
Aug 31, 2009
Messages
28
Location
Michigan
Programming Experience
5-10
Just started a project with 2010 and noticed that when I run the project it isn't stopping when an error occurs? Is there a setting somewhere that will cause this? It hits an error in a function, then just skips out of it and shows the form anyway instead of displaying and error message and stopping where the exception occurs.
 
Is this occurring in the Load event handler of the form by any chance? That's standard behaviour. For some reason they chose to swallow exceptions thrown in the Load event handler. I think that it's OS-dependent but I'm not sure.
 
Hmmm, I didn't know that. Yes, the subroutines were called from the load event. As a test I put a button on the form, commented out the call from the load event, and called them using the button after it had loaded. From there everything worked as expected. Using Windows 7 64 bit by the way.

Is there an option to change that?
 
If there's code that can reasonably throw an exception then you should have it wrapped in a Try...Catch block anyway. That goes doubly for a Load event handler for this reason. As far as I'm aware, there's nothing you can do about it.
 
Back
Top