Hot Reload has topped our user research for years. The first request landed in 2019, and in our most recent survey, it scored higher than any other feature we asked about: 70% of respondents noted they were ‘extremely interested’, and only 4% had ‘no interest’ at all. Today we’re pleased to share that we’re shipping it.
AvaloniaUI.DiagnosticsSupport.HotReload applies your .axaml and .cs edits to a running application without restarting it. Save a file, and the matching controls, styles, resources and data templates rebuild in place. It’s generally available now on Windows, macOS, Linux, iOS and Android.
Getting started requires three steps.
- Install the
AvaloniaUI.DiagnosticsSupport.HotReloadNuGet package - Add your
AvaloniaUILicenseKeyto the application project, - Run the app with
dotnet watch, Visual Studio, or Visual Studio Code with C# Dev Kit.
That’s all there is to it.
The hidden complexity of Hot Reload
Hot Reload solutions are challenging because they’re multifaceted; you need both an excellent platform to handle it and tooling to back it up. We can handle the former, but the latter is tricky. The approach you choose for processing changes, getting them to the device, and ensuring they apply without breaking requires many moving parts to work. For a small team that is also maintaining the platform, that investment has been tough to justify.
The community has created implementations, including current ones such as HotAvalonia. Using file watchers and some very clever code, they can take advantage of our build system and pipeline to swizzle XAML IL changes live in the app. It’s very impressive what projects like this have been able to do from the outside!
Seeing this, we wanted to ensure we can continue to keep Avalonia Hot Reload-friendly, opening hooks in the platform to make changes accessible for us and others, while also building our own tooling that pushes the limits of what our platform can do in a way we can manage and extend. We wanted to build Hot Reload tooling that can take advantage of many of the advancements in .NET’s tooling.
How it works
Rather than inventing another bespoke TCP stack, we build on .NET Hot Reload. Microsoft has invested heavily in it for .NET MAUI, including Android and iOS support in .NET 11, which we inherit for free. Standardising on the runtime's own toolset lets us focus on the Avalonia side and avoid adding more tooling for you to install.
Save an .axaml file, and the agent works out what changed and applies it to the running app. C# edits, such as a view model change, land in the same motion, so they're visible without renavigating.
Where possible, the change is applied to the specific element you edited, so its state survives and nothing around it is rebuilt. The logs tell you what happened for each change. It's early days; some edits will still fall back to a full reload of the element, which resets the view's context.
Pricing and availability
AvaloniaUI.DiagnosticsSupport.HotReload is a licensed Avalonia package, available now on NuGet. It’s covered by the Avalonia Plus, Pro and Enterprise tiers, and as promised, everyone on the legacy Accelerate plan receives it too. If you already hold a licence for Charts, TreeDataGrid, Markdown or Media Player, you’re already covered; grab the key from the customer portal and add it to your app.
It isn’t included in the community tier. If you’d like to try it, start a 30 day trial of Avalonia Pro.
The road ahead
This release is a foundation, with a solid engine underneath it that we'll keep extending.
Some of us have shipped hot reload before, and the lesson from that work was that the bugs which matter only show up in customers' real apps, never in simple samples. Take it for a spin and tell us what breaks. That feedback is what'll shape the next release.