|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: Use Edit and Continue (C#)
This topic applies to:
Pro and Team
Does not apply
Command or commands hidden by default.
With Edit and Continue for C#, you can make changes to your code in break mode while debugging. The changes can be applied without having to stop and restart the debugging session.
Edit and Continue is invoked automatically when you make changes in break mode, then choose a debugger execution command, such as Continue, Step, or Set Next Statement, or evaluate a function in a debugger window.
Edit and Continue is not supported when debugging 64-bit code, the Compact Framework, optimized code, mixed native/managed code, or SQL CLR code. If you try to apply code changes in one of these scenarios, the debugger puts up a dialog box explaining that Edit and Continue is not supported.
To invoke Edit and Continue automatically
In break mode, make a change to your source code.
From the Debug menu, click Continue, Step, or Set Next Statement or evaluate a function in a debugger window.
The new code is compiled and the debugging continues with the new code. Some changes are not supported by Edit and Continue. For more information, see Supported Code Changes (C#).
To enable/disable Edit and Continue
On the Tools menu, click Options.
In the Options dialog box, expand the Debugging node, and select Edit and Continue.
In the Options dialog box Edit and Continue page, select or clear the Enable Edit and Continue check box.
The setting takes effect when you restart the debugging session.