Microsoft KB Archive/919808

= &quot;Unable to set the next statement to this location&quot; error message when you are debugging a Visual Studio 2005 application =

Article ID: 919808

Article Last Modified on 12/11/2006

-

APPLIES TO


 * Microsoft Visual Studio 2005 Professional Edition
 * Microsoft Visual Studio 2005 Standard Edition
 * Microsoft Visual Studio 2005 Express Edition
 * Microsoft Visual Basic 2005
 * Microsoft Visual C# 2005 Express Edition
 * Microsoft Visual Studio 2005 Team System Architect Edition
 * Microsoft Visual Studio 2005 Team System Developer Edition
 * Microsoft Visual Studio 2005 Team Foundation
 * Microsoft Visual Studio 2005 Team System Test Edition

-





SYMPTOMS
When you are debugging a Microsoft Visual Studio 2005 application and you try to set the next statement, you may receive an error message that resembles the following error message:

Unable to set the next statement to this location. There is no executable code at this location in the source code.



CAUSE
The Debugger Engine is picking the statements in sequence. As long as the caret is at the end of the line, the Debugger Engine will set the next statement on the next line. If there is no executable code from the next line, an error message will occur.



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the &quot;Applies to&quot; section.



Visual Basic 2005
 Start Visual Studio 2005. Click the File menu, click New, and then click Project. Expand Visual Basic, click Console Application, type ConsoleApplication1 in the Name text box, and then click OK.  Replace the code in the Module1.vb file with the following code. Module Module1

Sub Main Dim x As Integer x = 1 End Sub

End Module  Set a Breakpoint on the x = 1 line.</li> Click the Debug menu, and then click Start Debugging.</li> Position the cursor to the right of the b in End Sub, right-click with the caret in the same position as the cursor, and then click Set Next Statement.</li></ol>

You then see the error message that is mentioned in the symptoms section.

Visual C# 2005
<ol> Start Visual Studio 2005.</li> Click the File menu, click New, and then click Project.</li> Expand Visual C#, click Console Application, type ConsoleApplication1 in the Name text box, and then click OK.</li>  Replace the code in the Program.cs file with the following code. using System; using System.Collections.Generic; using System.Text;

namespace ConsoleApplication2 {   class Program {       static void Main(string[] args) {           int x;            x = 1; }   } } </li> Set a Breakpoint on the x = 1; line.</li> Click the Debug menu, and then click Start Debugging.</li> Position the cursor to the right of the closing curly brace for the static void Main method, right-click with the caret in the same position as the cursor, and then click Set Next Statement.</li></ol>

You then see the error message that is mentioned in the symptoms section.

Additional query words: SetNextStatement

Keywords: kbtshoot kberrmsg kbinfo kbprb KB919808

-

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

© Microsoft Corporation. All rights reserved.