Edit running code with Hot Reload
You can edit the code of a suspended program and then continue debugging without the need to restart the session. The affected project will be recompiled in the background and synced with the debugger.
note
Debugging with Hot Reload requires .NET 8 as the target framework.
This behavior is enabled by default, but you can disable it by clearing the Enable Hot Reload when debugging checkbox on the Build, Execution, Deployment | Hot Reload page of JetBrains Rider settings . When Hot Reload is disabled for debugging, you can make any edits, but they will not be synced with the debugger.
When Hot Reload is enabled for debugging, there are two ways to apply changes that you made. You can choose one of them with the Automatically apply changes on step and resume option on the Build, Execution, Deployment | Hot Reload page of JetBrains Rider settings :
If this option is off, your changes will not be synchronized with the debugger when you step or resume the process, instead, you will need to apply your changes explicitly: click Apply changes on the editor banner that appears or choose Apply changes from the popup.
This approach is similar to the Hot Swap in Java debuggers. It lets you continue debugging regardless of your changes, and it works well when your changes do not affect the code you are currently stepping over.
If this option is on, all changes that you made when the process is paused in the debug session will be applied automatically as soon as you use one of the stepping commands or resume the process , but you will always be notified of the changes and be able to apply them explicitly:
Note that the changes will be sent to the process before the debugger makes the next step or resumes the program. Therefore, the debugging session could be broken, for example if your changes lead to a build failure. This approach is similar to Visual Studio debugger. Although your changes can break the debugging session, it makes sure that the code in the editor is synchronized with the debugger at each step.
Hot Reload also works when you run code without debugging , which can be helpful when testing ASP.NET Web Applications.
note
When running, Hot Reload works cross-platform with projects targeting .NET 6.0 or later.
This behavior is enabled by default, but you can disable it by clearing the Enable Hot Reload when running without debugging (.NET 6.0 and later) checkbox on the Build, Execution, Deployment | Hot Reload page of JetBrains Rider settings . When Hot Reload is disabled for running, you can make any edits, but they will not be synced with the running application.
If you use Visual Studio keymap, you can press to apply changes. For other keymaps, you can assign a custom shortcut to the Apply Hot Reload Changes action.
There are cases when modifying the code is not possible and a restart is required. These include changing signatures, modifying generic functions, renamings of any kind, and some more. If this happens JetBrains Rider will make you aware by showing a tooltip.
Hot Reload is not supported in F# and VB applications.
Hot Reload does not support changes made to the UI formats in frameworks like WPF, Windows Forms, and .NET MAUI.
When applying Hot Reload to ASP.NET Core applications (except Blazor WASM), the browser does not refresh automatically.