maui-hot-reload-diagnostics
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "maui-hot-reload-diagnostics" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-9688001e5a6509fa542fea47683022c2991100d64edf025efa54be74f321d361. Verify the upstream source and version against https://github.com/davidortinau/maui-skills before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
github.com
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
Guide for diagnosing and troubleshooting .NET MAUI hot reload issues, covering C# hot reload, XAML hot reload, Blazor Hybrid, all UI approaches (XAML, MauiReactor, C# Markup, Blazor Hybrid), Visual Studio and VS Code settings, environment variables, coding requirements, and MetadataUpdateHandler. Suitable for hot reload not working, XAML/C# hot reload, UI not updating, hot reload troubleshooting, MetadataUpdateHandler, Blazor Hybrid hot reload, and DOTNET_WATCH related issues. Not for general build errors, app lifecycle, or performance analysis.
Introduction source: third_party · davidortinau · 0.0.1 Reference
SkillPi interpretation
- Tasks
- Systematically diagnose Hot Reload failures for .NET MAUI apps.
- Software, accounts and paid services
- CRITICAL: All `.cs` files must be UTF-8 with BOM encoding.** ```bash
- Limits and differences
- These changes **always** require restart: Adding new components Modifying `@inject` services Static asset changes (images, fonts) Changes to `Program.cs` or `MauiProgram.cs` These usually work without restart: Razor markup and C# code block changes CSS changes (may need hard refresh if cached) Changing component parameters ⚠️ **CSS isolation**: If `.razor.css` changes don't apply, verify the isolated CSS file is properly linked.
- Testing
- Not tested
Browse files
Frontmatter
name: maui-hot-reload-diagnostics
description: >
Diagnose and troubleshoot .NET MAUI Hot Reload issues (C# Hot Reload, XAML Hot Reload,
Blazor Hybrid). Covers all UI approaches (XAML, MauiReactor, C# Markup, Blazor Hybrid),
Visual Studio, VS Code, environment variables, encoding requirements, and MetadataUpdateHandler.
USE FOR: "hot reload not working", "XAML hot reload", "C# hot reload", "UI not updating",
"hot reload troubleshooting", "MetadataUpdateHandler", "hot reload Blazor Hybrid",
"hot reload VS Code", "DOTNET_WATCH".
DO NOT USE FOR: general build errors (not hot reload related), app lifecycle events
(use maui-app-lifecycle), or performance profiling (use maui-performance)..NET MAUI Hot Reload Diagnostics
Systematically diagnose Hot Reload failures for .NET MAUI apps.
Quick diagnosis checklist
- Identify what's failing: XAML Hot Reload (
.xamlchanges) vs C# Hot Reload (.cschanges) - Check run configuration: Must be Debug config, started with F5/debugger attached
- Save file and re-execute code path: C# changes require re-triggering the code
- Check Hot Reload output: View > Output > "Hot Reload" (VS) or "C# Hot Reload" (VS Code)
⚠️ File encoding requirement
CRITICAL: All .cs files must be UTF-8 with BOM encoding.
# Check if file has BOM (should show "UTF-8 Unicode (with BOM)")
file -I *.cs
# Find files without BOM
find . -name "*.cs" -exec sh -c 'head -c 3 "$1" | od -An -tx1 | grep -q "ef bb bf" || echo "$1"' _ {} \;
# Fix: convert to UTF-8 with BOM
sed -i '1s/^\(\xef\xbb\xbf\)\?/\xef\xbb\xbf/' file.cs
# Or in VS Code: Open file > Save with Encoding > UTF-8 with BOM
Common issues and fixes
"Nothing happens when I save"
- Verify Debug configuration (not Release)
- Check Hot Reload output for errors
- Ensure file is saved (not just modified)
- Re-execute the code path (navigate again, tap button again)
"Unsupported edit" / "Rude edit"
Some changes always require app restart:
- Adding/removing methods, fields, properties
- Changing method signatures
- Modifying static constructors
- Changes to generics
XAML changes don't apply (iOS)
- ⚠️ Set Linker to Don't Link in iOS build settings
- Config must be named exactly Debug
- Don't use
XamlCompilationOptions.Skip
Changes apply but UI doesn't update
- For C#: Must re-trigger the code (re-navigate, re-tap)
- Check for cached binding values or state
- Verify you're editing the correct target framework file
Framework-specific pitfalls
MauiReactor v3+
<!-- ✅ Correct — feature switch in .csproj -->
<ItemGroup Condition="'$(Configuration)'=='Debug'">
<RuntimeHostConfigurationOption Include="MauiReactor.HotReload" Value="true" Trim="false" />
</ItemGroup>
// ❌ Wrong — v2 API, remove for v3+
.EnableMauiReactorHotReload()
⚠️ If migrating from MauiReactor v2, remove the EnableMauiReactorHotReload() call from MauiProgram.cs.
C# Markup (CommunityToolkit.Maui.Markup)
Key points — missing any of these breaks hot reload:
- ⚠️ Extract UI building into a separate
Build()method - ⚠️ Implement
ICommunityToolkitHotReloadHandleron any page/view needing refresh - The
OnHotReload()method is called automatically after C# hot reload - Must call
.UseMauiCommunityToolkitMarkup()inMauiProgram.cs
Blazor Hybrid limitations
These changes always require restart:
- Adding new components
- Modifying
@injectservices - Static asset changes (images, fonts)
- Changes to
Program.csorMauiProgram.cs
These usually work without restart:
- Razor markup and C# code block changes
- CSS changes (may need hard refresh if cached)
- Changing component parameters
⚠️ CSS isolation: If .razor.css changes don't apply, verify the isolated CSS file is properly linked.
Decision framework — which hot reload type?
| UI approach | What reloads | Watch out for |
|---|---|---|
| XAML | .xaml files (instant) |
Linker must be off on iOS; config must be "Debug" |
| C# code-behind | Method bodies only | Must re-trigger code path; rude edits require restart |
| MauiReactor v3+ | Component re-render | Need RuntimeHostConfigurationOption, not code call |
| C# Markup | Build() method body |
Must implement ICommunityToolkitHotReloadHandler |
| Blazor Hybrid | .razor + .css |
New components/services need restart |
Debugging tips
- ⚠️ Always check the Hot Reload output window first — it tells you exactly why a change was rejected.
- Enable detailed logging with env vars before launching IDE (see
references/hot-reload-setup.md). - Binary logs (
dotnet build -bl:build.binlog) help diagnose build-related hot reload failures. - When reporting bugs, include:
dotnet --info, workload list, binary log, and Hot Reload output.
Quick checklist
- [ ] Debug configuration selected (not Release)
- [ ] Debugger attached (F5, not Ctrl+F5)
- [ ] All
.csfiles are UTF-8 with BOM - [ ] Hot Reload output window checked for errors
- [ ] Code path re-triggered after C# changes
- [ ] MauiReactor:
RuntimeHostConfigurationOptionin.csproj(not code call) - [ ] C# Markup:
ICommunityToolkitHotReloadHandlerimplemented - [ ] Blazor Hybrid: not changing services/startup code
Current listing version
0.0.1
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 针对 .NET MAUI 热重载这一明确开发痛点,提供系统性诊断流程
- 覆盖 XAML、C#、MauiReactor、C# Markup、Blazor Hybrid 等多种技术栈
- 包含快速检查清单和决策框架,实用性强
Highlights
- 适用与不适用场景描述清晰,关键词覆盖全面
- 边界定义明确,避免与其他 Skill 功能重叠
Areas to improve
-
缺少显式 When to Use 章节标题 Reported severity: Minor
文档内容已涵盖适用场景,但未使用标准章节标题 'When to Use'
Recommendation: 建议添加显式的 'When to Use' 章节以提升规范性
Highlights
- Phase/步骤清晰,包含快速检查清单和决策框架
- 提供了端到端配置示例和常见陷阱说明
Areas to improve
-
部分命令缺少安全确认机制说明 Reported severity: Minor
sed -i 等命令直接修改文件,未提醒用户备份或确认
Recommendation: 建议在危险操作前添加确认提示或备份建议
Highlights
- 提供了具体的命令行操作和配置示例
- 覆盖了编码、Linker、框架配置等主要异常场景
- 工具来源明确,参数正确
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
These common operations were not identified in the main document. This does not mean no permissions or risks exist.
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
CRITICAL: All `.cs` files must be UTF-8 with BOM encoding.** ```bash
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.