Microsoft KB Archive/319964

= The debugging session ends and returns to design mode in a Visual Basic .NET or Visual Basic 2005 project =

Article ID: 319964

Article Last Modified on 12/6/2006

-

APPLIES TO


 * Microsoft Visual Basic 2005
 * Microsoft Visual Basic .NET 2003 Standard Edition
 * Microsoft Visual Basic .NET 2002 Standard Edition

-



This article was previously published under Q319964



SYMPTOMS
If you debug a Visual Basic .NET or Visual Basic 2005 project in break mode, the debugging session ends and the project returns to design mode.



CAUSE
This behavior occurs if you try to evaluate a variable or function in break mode after you receive a System.StackOverflowException exception.



STATUS
This behavior is by design.



Steps to Reproduce the Behavior
 Start Microsoft Visual Studio .NET or Microsoft Visual Studio 2005. Create a new Console Application project using Microsoft Visual Basic. By default, Module1 is created.  Replace the contents of Module1 with the following code: Module Module1 Public i As Integer = 10

Sub Main MyProc End Sub

Sub MyProc

'Recursively call the same procedure until 'a StackOverFlowException is thrown MyProc End Sub End Module  Save the project. On the Debug menu, click Start. Note that the code execution stops with the following exception:

An unhandled exception of type 'System.StackOverflowException' occurred in .exe

</li> Click Break to enter break mode.</li> On the Debug menu, point to Windows, and then click Immediate.</li>  Run the following statement from the immediate window to print the current value of the variable: ?i Note that the project resets and is no longer in break mode. </li></ol>

Keywords: kbvs2005swept kbvs2005applies kbvs2002sp1sweep kbbug kbdebug kbnofix kbprb KB319964

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.