Udostępnij za pośrednictwem


How to: Apply Edits in Break Mode with Edit and Continue (Visual Basic)

Applies to: yesVisual Studio noVisual Studio for Mac

Note

This article applies to Visual Studio 2017. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here

You can use Edit and Continue to edit your code in Break mode, and then continue without stopping and restarting execution.

For limitations on using Edit and Continue while debugging, see Supported Code Changes (C# and Visual Basic).

To edit code in Break mode

  1. Enter Break mode by doing one of the following:

    • Set a breakpoint in your code, then choose Start Debugging from the Debug menu and wait for the application to hit the breakpoint.

      -or-

    • Start debugging, and then select Break All from the Debug menu.

      -or-

    • When an exception occurs, choose Enable Editing on the Exception Assistant.

  2. Make any desired and supported code changes.

    For more information, see Supported Code Changes (C# and Visual Basic).

    Note

    If you attempt to make a code change that is not allowed by Edit and Continue, your edit will be underlined by a purple wavy line and a task will appear in the Task List. You will not be able to continue code execution unless you undo the illegal code change.

  3. On the Debug menu, click Continue to resume execution.

    Your code now executes with your applied edits incorporated into the project.

See also