Edit running code with Hot Reload
Make changes when debugging
You can edit the code of a suspended program and then continue debugging without the need to restart the session. The affected project will recompile in the background and synced with the debugger.
This behavior is enabled by default, but you can disable it by clearing the Enable Hot Reload when debugging checkbox on the page of JetBrains Rider settings Ctrl+Alt+S. 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 page of JetBrains Rider settings Ctrl+Alt+S:
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 Alt+Enter 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 F9, 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.
Make changes when running
Hot Reload also works when you run code without debugging Shift+F10, which can be helpful when testing ASP.NET Web Applications.
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 page of JetBrains Rider settings Ctrl+Alt+S. When Hot Reload is disabled for running, you can make any edits, but they will not be synced with the running application.
Apply changes with a keyboard shortcut
If you use Visual Studio keymap, you can press Alt+F10 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 as well as in Blazor WebAssembly (WASM).
When applying Hot Reload to an ASP.NET Core application, the browser does not refresh automatically.