Microsoft Knowledge Base Email Alertz

KBAlertz.com: Unable to set the next statement to this location error message when you are debugging a Visual Studio 2005 application

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]

Search KbAlertz

Advanced Search

Webmasters
Put kbAlertz on your website.
[ Click Here for more! ]





ASP.NET 3.5 Web Hosting with Windows 2008 and SQL 2008: Click Here!
Discount ASP.NET Hosting
ASP.NET 2.0 and 3.5
Windows2008 and SQL2008
US and UK Hosting
KBAlertz referrals get
** SIX MONTHS FREE **


Community Site



We Send hundreds of thousands of emails using ASP.NET Email


ASP.NET 3.5 Web Hosting with Windows 2008 and SQL 2008: Click Here!
Discount ASP.NET Hosting
ASP.NET 2.0 and 3.5
Windows2008 and SQL2008
US and UK Hosting
KBAlertz referrals get
** SIX MONTHS FREE **




Mentioned In








Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks




Article ID: 919808 - Last Review: December 11, 2006 - Revision: 1.6

"Unable to set the next statement to this location" error message when you are debugging a Visual Studio 2005 application

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 "Applies to" section.

MORE INFORMATION

Steps to reproduce the behavior

Visual Basic 2005
  1. Start Visual Studio 2005.
  2. Click the File menu, click New, and then click Project.
  3. Expand Visual Basic, click Console Application, type ConsoleApplication1 in the Name text box, and then click OK.
  4. 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
    
  5. Set a Breakpoint on the x = 1 line.
  6. Click the Debug menu, and then click Start Debugging.
  7. 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.
You then see the error message that is mentioned in the symptoms section.

Visual C# 2005
  1. Start Visual Studio 2005.
  2. Click the File menu, click New, and then click Project.
  3. Expand Visual C#, click Console Application, type ConsoleApplication1 in the Name text box, and then click OK.
  4. 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;
            }
        }
    }
    
  5. Set a Breakpoint on the x = 1; line.
  6. Click the Debug menu, and then click Start Debugging.
  7. 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.
You then see the error message that is mentioned in the symptoms section.

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
Keywords: 
kbtshoot kberrmsg kbinfo kbprb KB919808
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate

Be the first to leave feedback, to help others about this knowledge base article.

(Optional) Name

(Optional) Public URL Or Email

Comments
No HTML -- Text Only Please