|Important||This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.|
How to: Apply Edits in Break Mode with Edit and Continue
This topic applies to:
Pro and Team
Does not apply
Command or commands hidden by default.
You can use Edit and Continue to edit your code in Break mode, and then continue without stopping and restarting execution.
Edit and Continue is not available in the following debugging scenarios:
Mixed-mode (native/managed) debugging.
Debugging a Dr. Watson dump.
Editing code after an unhandled exception, when the Unwind the call stack on unhandled exceptions option is not selected.
Debugging an embedded runtime application.
Debugging an application with Attach to rather than running the application with Start from the Debug menu.
Debugging optimized code.
Debugging managed code when the target is a 64-bit application. If you want to use Edit and Continue, you must set the target to x86. (Project Properties, Compile tab, Advanced Compiler setting.).
Debugging an old version of your code after a new version failed to build due to build errors.
To edit code in Break mode
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.
Start debugging, and then select Break All from the Debug menu.
When an exception occurs, choose Enable Editing on the Exception Assistant.
Make any desired and legal code changes.
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 underline 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.
On the Debug menu, click Continue to resume execution.
Your code now executes with your applied edits incorporated into the project.