Compartilhar via


C# Edit and Continue: erro 4003

Editing or deleting an active statement inside of an anonymous method will prevent the debug session from continuing while Edit and Continue is enabled.

This error indicates that you tried to edit an active statement within an anonymous method.

For example, consider the following code:

class Program

   {

      delegate void D();

      static void Main()

      {

         D d = delegate

         { System.Console.WriteLine("Inside anonymous method");

      };

      d();

   }

}

Se você definir um ponto de interrupção na linha com o System.Console.WriteLine chamar, em seguida, depurar o aplicativo e tente editar o WriteLine chamar, este erro ocorre.

For more information, see Active Statements.

To correct this error

  • Undo the changes, and then continue debugging without the changes. You can make the edits later when the statement is no longer active.

    —or—

    On the Debug menu, click Restart.

    This will end the debug session and start a new session.

Consulte também

Referência

Alterações de código suportadas (C#)

Edição e continuação (Visual C#)

Anonymous Methods (C# Programming Guide)

Outros recursos

Editar e continuar a erros e avisos (C#)