Article ID: 832681
Article Last Modified on 4/29/2007
APPLIES TO
- Microsoft Visual Studio .NET 2003 Professional Edition
- Microsoft Visual Studio .NET 2003 Academic Edition
- Microsoft Visual Studio .NET 2003 Enterprise Architect
- Microsoft Visual Studio .NET 2003 Enterprise Developer
- Microsoft Visual Studio .NET 2002 Academic Edition
- Microsoft Visual Studio .NET 2002 Enterprise Architect
- Microsoft Visual Studio .NET 2002 Enterprise Developer
- Microsoft Visual Studio .NET 2002 Professional Edition
SYMPTOMS
When 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.
CAUSE
This 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.
RESOLUTION
To 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
Keywords: kbdebug kbexcepthandling kbwindowsforms kbprb KB832681