Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
With Hot Reload, or Edit and Continue for C#, you can make changes to your code in break or run mode while debugging. The changes can be applied without having to stop and restart the debugging session.
The basic Hot Reload experience works with most types of .NET apps and framework versions. This includes .NET Framework, .NET Core and .NET 5+ (for both C# and Visual Basic as applicable). The expectation in this scenario is that if you’re using the debugger, assume Hot Reload is available to you and give it a try!
Hot Reload supports most changes you might want to make during a debugging session, but there are some exceptions. For example, Hot Reload isn't supported for optimized code or debugging sessions with the managed and native debugger enabled.
For information on other unsupported scenarios, see Supported code changes (C# and Visual Basic). If you try to apply code changes with one of these scenarios, a message box appears stating that Hot Reload isn't supported.
Use Hot Reload
Hot Reload for C# happens automatically when you make code changes in break mode, then continue debugging by using Continue, Step, or Set Next Statement. If you set Hot Reload on file save to true, it will also happen automatically when saving a file.
To enable or disable Hot Reload:
- If you're in a debugging session, stop debugging (Debug > Stop Debugging or Shift + F5).
Open the Tools > Options pane, and expand the All Settings > Debugging > .NET/C++ Hot Reload section.
Select or clear the desired Enable Hot Reload options for the feature.
Open the Tools > Options dialog, and expand the Debugging > .NET/C++ Hot Reload section.
Select or clear the desired Enable Hot Reload options for the feature, and select OK.
The setting takes effect when you start or restart the debugging session.
To use the classic Edit and Continue experience:
While debugging, in break mode, make a change to your source code.
From the Debug menu, select Continue, Step, or Set Next Statement. Debugging continues with the new, compiled code.
Some types of code changes aren't supported by Edit and Continue. For more information, see Supported code changes (C# and Visual Basic).