Using Rider's .NET Hot Reload for Faster UI Iteration
Learn how Rider’s .NET Hot Reload lets you apply code changes to a running ASP.NET Core or Blazor app without a full restart, preserving state and cutting feedback time.
21 Oct 2025, 13:38 UTC

The Problem: Slow UI Feedback Loop
When developing ASP.NET Core or Blazor applications, a typical change‑to‑see workflow involves stopping the debugger, rebuilding the project, and relaunching the app. Even a modest rebuild can take several seconds, breaking concentration and slowing UI experimentation.
How Rider's Hot Reload Works
Rider plugs into the .NET Hot Reload infrastructure. When you start the app with the IDE’s Hot Reload button (or via dotnet watch), Rider monitors file saves. On each save, it compiles the changed C# or Razor file to intermediate language (IL) and injects the new IL into the running process, preserving the existing state such as HTTP context or component instance data.
Supported edits include method bodies, property implementations, and UI markup in Razor or Blazor files. Changes that alter the public surface of an assembly—adding a new public type, modifying a method signature, or changing inheritance—cannot be hot‑reloaded and trigger a full restart.
Setting Up Hot Reload in Rider
- Open the project in Rider (2023.3 or later).
- From the main toolbar, click the Debug drop‑down and select Hot Reload (the lightning‑bolt icon). This launches the app under the debugger with Hot Reload enabled.
- Alternatively, edit the launch profile to set
"commandName": "Project"and"dotnetWatch": true, then start the profile. - Make sure the Debug tool window shows the message Hot Reload applied after a file save; if you see Hot Reload skipped or no message, the change required a restart.
Worked Example: Updating a Blazor Component
Assume a Blazor Server project with a component Counter.razor that displays a count and increments it on button click.
@page "/counter"
Counter
Current count: @currentCount
Click me
@code {
private int currentCount = 0;
private void IncrementCount()
{
currentCount++;
}
}
While the app is running with Hot Reload enabled:
- Place the cursor inside the
IncrementCountmethod. - Change the increment to
currentCount += 5;. - Save the file (Ctrl+S or Cmd+S).
- Observe the Debug window flash Hot Reload applied.
- Click the button in the browser; the count now jumps by five without a restart.
If you instead add a new public method to the component’s @code block, saving will produce Hot Reload skipped and the app will restart, illustrating the limitation.
Trade‑offs and Limitations
- Surface‑area changes: Adding new types, altering method signatures, or changing inheritance forces a full rebuild.
- Docker / remote debugging: Hot Reload requires the source directory to be mounted into the container and the ASP.NET Core debugging agent to be enabled (
ASPNETCORE_HOSTINGSTARTUPASSEMBLIES=Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation). Without these, the IDE cannot inject IL. - Performance variance: While typical cycles stay under 200 ms for small edits, larger files or complex Razor pages may approach the time of a incremental build.
Getting Started Today
To reap the fastest UI feedback loop:
- Enable Hot Reload from Rider’s debug toolbar before you start coding.
- Keep edits to method bodies, property logic, and markup; reserve structural changes for moments when a restart is acceptable.
- When working with containers, add a volume mount for the source folder and launch the container with debugging support (
dotnet run --configuration Development). - Watch the Debug window for the Hot Reload confirmation; treat its absence as a cue to rebuild.
By integrating this workflow, you reduce the edit‑compile‑run cycle from seconds to sub‑second bursts, letting you experiment with UI tweaks and logic changes without losing application state.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.