Exceptions in asynchronous delegates
-
Monday, April 03, 2006 9:45 PM
I purposefully throw an exception from within my asynchronous delegate under specific circumstances. When running under .NET 1.1 and VS .NET 2003, I can easily process these exceptions by calling EndInvoke. Now, while debugging under .NET 2.0 and VS .NET 2005, the debugger, annoyingly warns me that the exception was not handled in user code even though the exception was handled on the calling thread.
Microsoft Visual Studio
An exception of type 'cmi.communication.compinterface.SendCommandException' occurred in cmi.comp.ip.modbus.tcp.dll but was not handled in user code
Additional information: The send command operation failed.
Presenting this warning to customers using my component will inevitably lead them to believe that there is something wrong in the component. Or, at the very least, they too will be annoyed while debugging their code. How can this ‘feature’ be controlled?
Answers
-
Tuesday, April 04, 2006 1:54 AMOwner
To disable this feature, you can uncheck the "User-unhandled" checkbox for the exception that you are interested in. You can find this option in Debug -> Exceptions.
Habib Heydarian
Program Manager
Visual Studio Debugger

