An exception occurs in the callback function and the Visual Studio .NET debugger does not receive the program control when a callback function does not contain code to handle exceptions in the try/catch block (832681)
The information in this article applies to:
- Microsoft Visual Studio .NET (2003), Professional Edition
- Microsoft Visual Studio .NET (2003), Academic Edition
- Microsoft Visual Studio .NET (2003), Enterprise Architect Edition
- Microsoft Visual Studio .NET (2003), Enterprise Developer Edition
- Microsoft Visual Studio .NET (2002), Academic Edition
- Microsoft Visual Studio .NET (2002), Enterprise Architect Edition
- Microsoft Visual Studio .NET (2002), Enterprise Developer Edition
- Microsoft Visual Studio .NET (2002), Professional Edition
SYMPTOMSWhen a callback function does not contain code to handle exceptions in the try/catch block, an exception may occur in the callback function and the Microsoft Visual Studio .NET debugger may not receive the program control. The unhandled exception that appears in the Call Stack window may not be the expected exception.CAUSEThis problem occurs because the Microsoft .NET Framework handles the exception and then rethrows the exception
to the debugger. The debugger may not provide the correct location of the exception.RESOLUTIONTo resolve this problem, set the Exceptions option to Break into the debugger for the first-chance exceptions in your debug exceptions, as follows:
- Open a project in the Visual Studio .NET IDE.
- On the Debug menu, click Exceptions.
The Exceptions dialog box appears. - Expand Common Language Runtime Exceptions.
- Expand System.
- Click System.Argument Exception.
- Under When the exception is thrown, click Break into the debugger. Click OK.
STATUS
This behavior is by design.REFERENCES
For additional information, click the following article number to view the article in the Microsoft Knowledge Base:
105675
INFO: First and second chance exception handling
For more information, visit the following Microsoft Web site:
Modification Type: | Minor | Last Reviewed: | 4/6/2004 |
---|
Keywords: | kbDebug kbExceptHandling kbWindowsForms kbprb KB832681 kbAudDeveloper |
---|
|