The Hot Reload mechanism, previously called Edit and Continue, handles most types of code changes within method bodies. Most changes outside method bodies, and a few changes within method bodies, can't be applied during debugging, however. To apply those unsupported changes, you must stop debugging and restart with a fresh version of the code.
The Edit and Continue mechanism handles most types of code changes within method bodies. Most changes outside method bodies, and a few changes within method bodies, can't be applied during debugging, however. To apply those unsupported changes, you must stop debugging and restart with a fresh version of the code.
Supported changes to codeThe following table shows the changes that might be made to C# and Visual Basic code during a debugging session without restarting the session.
Language element or feature Supported edit operation Limitations Types Add methods, fields, constructors, and more Yes Iterators Add or modify No async/await expressions Add or modify Yes Dynamic objects Add or modify No lambda expressions Add or modify Yes LINQ expressions Add or modify Same as lambda expressions Generics Add or modify Yes Language element or feature Supported edit operation Limitations Types Add methods, fields, constructors, and more Yes Iterators Add or modify No async/await expressions Add or modify Yes Dynamic objects Add or modify No lambda expressions Add or modify Yes LINQ expressions Add or modify Same as lambda expressionsNote
Newer language features such as string interpolation and null-conditional operators are generally supported by Edit and Continue. For the most current information, see the Enc Supported Edits page. For .NET Framework, the supported features are a subset of the listed features and are dependent on the compiler version.
.NET 6+ improvementsImprovements in .NET 6+ and Visual Studio 2022 and later versions include support for more types of edits that go beyond what was originally possible in older versions of Visual Studio. These improvements are available to both Hot Reload and the Edit and Continue experiences.
The .NET 6+ Hot Reload experience is powered by the Edit and Continue mechanism and Roslyn. Supported Edits lists the types of edits currently supported by Roslyn and potential future enhancements.
Unsupported changes to codeThe following changes can't be applied to C# and Visual Basic code during a debugging session.
Changes to the current statement or any other active statement.
An active statement is any statement in a function on the call stack that was called to get to the current statement.
The current statement appears on a yellow background in the source window. Other active statements appear on a shaded background and are read-only. These default colors can be changed in the Options dialog box.
Any unsupported changes to code by language element as outlined in the following table.
For .NET 6+ and Visual Studio 2022, see Supported Edits for the types of edits currently supported and unsupported.
Language element or feature Unsupported edit operation All code elements Renaming Namespaces Add Namespaces, types, members Delete Interfaces Modify Types Add abstract or virtual member, add override (see details) Types Add destructor Members - Modify a member referencing an embedded interop typeChanges to unsafe code have the same limitations as changes to safe code, with one extra restriction: Edit and Continue doesn't support changes to unsafe code that exits within a method that contains the stackalloc
operator.
Supported applications include:
For .NET 6 and later, editing is supported for the following file types:
Unsupported applications or platforms include:
For ASP.NET and ASP.NET Core, editing isn't supported for the following file types:
Edit and Continue isn't available in the following debugging scenarios:
Mixed-mode (native/managed) debugging.
Debugging on Arm64 without targeting .NET 7 or later.
Debugging with the COR_ENABLE_PROFILING environment variable set.
Debugging an application using attach to process (Debug > Attach to Process) instead of running the application by choosing Start from the Debug menu. If you wish to use Edit and Continue when attaching to a process, the COMPLUS_ForceENC environment variable must be set prior to launching the process (set COMPLUS_ForceENC=1
).
Debugging with nondeterministic (for example, time based) assembly versions. If you wish to use Edit and Continue, consider setting the version only in Release (or CI) builds and keep the version in Debug builds constant.
Debugging optimized code.
SQL debugging.
Debugging a dump file.
Debugging an embedded runtime application.
Debugging an old version of your code after a new version failed to build because of build errors.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4