Skip to content

Diagnosing Hot Reload

David Ortinau edited this page Jan 23, 2026 · 6 revisions

Diagnosing Hot Reload Failures in .NET MAUI

This guide helps you:

  1. Self-diagnose Hot Reload failures (C#/.NET Hot Reload and XAML Hot Reload).
  2. Capture high-signal diagnostics you can zip up and share with the team for analysis.

Terminology (quick):

  • .NET Hot Reload (C# Hot Reload): Updates managed code while the app runs (powered by the debugger + compiler).
  • XAML Hot Reload: Updates XAML UI while the app runs.
  • In Visual Studio docs you’ll also see Edit and Continue (older name / related mechanism).

0) First: identify what’s failing

A. XAML Hot Reload is failing if…

  • Editing a .xaml file does not update the running UI.

B. C#/.NET Hot Reload is failing if…

  • Editing a .cs file does not take effect (even after re-triggering the code path), or Visual Studio reports the edit as unsupported.

It’s common for one to work while the other does not—diagnose them separately.


1) 5-minute checklist (fixes many “nothing happens” cases)

0. Make sure you are using the latest versions.

  • check for updates and when possible use the latest previews, pre-release, and Insiders versions. This is where fixes first appear.

1. Confirm you are in a supported run configuration

  • Use Debug configuration (not Release, not a custom configuration).
  • Start the app with F5 / Start Debugging for the most reliable Hot Reload experience.

Why this matters: Hot Reload is designed for debug builds and can be unavailable in Release/custom configurations.

2. Save the file and re-execute the code path

  • Hot Reload typically applies on file save.
  • For C# changes, you often must re-execute the code (tap the button again, re-navigate, re-run the timer tick, etc.) to see the updated behavior.

3. Look at the Hot Reload output

Before changing anything else, look for the reason Hot Reload didn’t apply:

  • Visual Studio: View > Output then select Hot Reload from the dropdown.
  • VS Code: View > Output then select C# Hot Reload (or C#) from the dropdown.
output-hot-reload

In VS Code you can also control the level of detail you see in the Output panel by tapping the settings icon in the Output panel header.

image

2) Visual Studio (Windows): verify settings + increase diagnostics

2.1 Verify Hot Reload is enabled

Visual Studio allows Hot Reload to be disabled at the IDE level.

  • Open Tools > Options
  • Search for Hot Reload
  • Verify settings under Debugging > .NET/C++ Hot Reload:
    • Enable Hot Reload
    • (Optional) Enable when not debugging (Ctrl+F5 scenario)
    • (Optional) Apply on file save
    • Logging verbosity: set to Detailed or Diagnostic when troubleshooting
image

2.2 Apply changes manually (when needed)

If you suspect auto-apply isn’t happening:

  • Use the Hot Reload toolbar button, or press Alt+F10 (Apply Code Changes) while debugging.

2.3 Common Visual Studio causes

  • Unsupported edit (“rude edit”): Hot Reload will tell you the edit can’t be applied without restart.
  • Build errors: if the new code doesn’t compile, Hot Reload can’t apply it.
  • Mixed-mode/native debugging: some mixed native/managed debugging scenarios disable Hot Reload.

3) XAML Hot Reload in .NET MAUI (Visual Studio)

3.1 Ensure XAML Hot Reload is enabled for the target platform

For MAUI, enable XAML Hot Reload in:

  • Debug > Options > XAML Hot Reload
  • Make sure the checkbox is enabled for the platform you’re debugging (Windows / Android / iOS, etc.)
image

3.2 MAUI-specific XAML Hot Reload requirements/limitations

For .NET MAUI XAML Hot Reload:

  • Your debug configuration must be named Debug.
  • On iOS, ensure the Linker is set to Don't Link.
  • XamlCompilationOptions.Skip is not supported.
  • Don’t add/remove NuGet packages or new source files while debugging—stop debugging, make structural changes, and restart.

If XAML updates still don’t apply: try a “full reload” from the Hot Reload UI (when available), or restart the debug session.


4) Visual Studio Code (VS Code): settings and known constraints

VS Code support depends on the MAUI and C# tooling you have installed and enabled.

4.1 Required extensions (VS Code)

  • Install the .NET MAUI extension for VS Code.
  • Ensure you have the current C# tooling (C# Dev Kit / C# extension, depending on your setup).

4.2 Enable C# Hot Reload (VS Code)

C# Hot Reload can be experimental in VS Code and may be disabled by default.

In VS Code Settings, search for “Hot Reload” and enable:

  • C# > Experimental > Debug: Hot Reload
  • C# Debug: Hot Reload On Save (recommended)

Also set:

  • C# Debug: Hot Reload Verbosity = detailed (or diagnostic) while troubleshooting.
image

4.3 Where to see VS Code Hot Reload logs

  • Open View > Output
  • Select C# Hot Reload (or C#) in the output dropdown
  • Reproduce the issue and copy the log output

5) “Hot Reload says it applied, but I don’t see changes”

This is often not a Hot Reload failure. Common causes:

  • You didn’t re-trigger the code path (C#): the old code already ran; invoke it again.
  • UI state is masking changes: e.g., cached binding values, navigation stack state, template caching.
  • You’re editing the wrong target in a multi-target MAUI project (e.g., you’re debugging Android but changed a Windows-only file).

Quick test:

  • Make a very obvious change (e.g., return a different constant string, change a label text) and re-run the relevant action.

6) High-signal diagnostics bundle (share with the team)

When reporting Hot Reload issues, please zip a folder containing as many of these as possible:

6.1 Environment + versions

  • Visual Studio version: Help > About Microsoft Visual Studio (copy/paste)
  • .NET SDK info:
    dotnet --info
  • Installed workloads:
    dotnet workload list

6.2 Hot Reload logs (IDE output)

  • Visual Studio:

    1. Set Tools > Options > Debugging > .NET/C++ Hot Reload > Logging verbosity to Diagnostic
    2. View > Output → select Hot Reload
    3. Reproduce the issue
    4. Copy the output into hot-reload-output.txt
  • VS Code:

    1. Set C# Debug: Hot Reload Verbosity to detailed/diagnostic
    2. View > Output → select C# Hot Reload (or C#)
    3. Reproduce the issue
    4. Copy the output into vscode-hot-reload-output.txt

6.3 MSBuild binary log (binlog)

A binlog captures exactly what MSBuild did and is extremely useful.

From a developer command prompt (or terminal):

dotnet build -bl:build.binlog -c Debug

For a specific target framework (example):

dotnet build -bl:build.binlog -c Debug -f net8.0-android

6.4 Optional: deeper Roslyn/Edit-and-Continue logs (advanced)

If you’re comfortable collecting internal diagnostics, you can set an environment variable to emit more detailed Edit-and-Continue logs.

Set the following environment variable before launching Visual Studio 2022/2026 or Visual Studio Code.

Windows:

set Microsoft_CodeAnalysis_EditAndContinue_LogDir=%temp%\HotReloadLog

Mac:

export Microsoft_CodeAnalysis_EditAndContinue_LogDir=/tmp/HotReloadLog

Then reproduce the problem and include the generated log folder in your zip.

Note: These logs may contain source code snippets/paths. Review before sharing externally.

6.5 Repro steps + minimal repro

Include a README.md with:

  • Exact steps (what you changed, where, expected vs actual)
  • Platform target (Android emulator, iOS simulator/device, Windows)
  • Whether it’s XAML or C# Hot Reload failing (or both)
  • If possible: a minimal repro project or a GitHub repo/branch

6.6 Suggested zip structure

hot-reload-diagnostics/
  README.md
  vs-about.txt
  dotnet--info.txt
  dotnet-workload-list.txt
  hot-reload-output.txt
  vscode-hot-reload-output.txt
  build.binlog
  enc-logs/               # if collected

7) Quick reference: common root causes

A. Unsupported change types (C# Hot Reload)

Some edits require a restart (e.g., many changes outside method bodies, signature changes, etc.).

  • See official “Supported code changes” documentation.

B. Debug-only limitation

Hot Reload is designed for debug builds; Release/custom configurations often disable it.

C. Attach-to-process vs Start Debugging

Some Hot Reload features (especially XAML Hot Reload) expect F5/Start Debugging.

D. MAUI/iOS specifics

  • XAML Hot Reload requires iOS Linker Don't Link and a Debug config named Debug.
  • Restart debugging after structural changes (new packages/files).

E. Networking

Make sure your physical Android or iOS device is on the same network as your development machine.


Official documentation links

Clone this wiki locally