I have written a command manager that uses 开发者_如何学JAVAreflection to make calls to various methods and it works wonderfully except that when an exception happens in one of the handlers the break into debugging happens in the command manager and not at the point the exception was originally thrown. Is there a way to get it to break into the exception immediately rather than at the point I call Invoke?
Open the Exceptions settings window by choosing Debug->Exceptions.
In there, you can find the CLR exception that is being thrown. You can change the setting to break when the exception is Thrown instead of User-unhandled.
That will make it break at the appropriate time.
Do you mean while debugging? If yes, then go to Debug menu -> Exceptions, then you can configure the debugger to break when an exception is thrown instead of when it is caught.
You can either enable that feature for all exceptions, or if you know the type of the exception that you're interested in, then you can enable it for only that exception.
精彩评论