dotnet add package RecursiveAI.OneApp dotnet add package RecursiveAI.OneUI
Requires .NET 10 (net10.0); .NET 9 and earlier aren’t supported.
Save this edit to NotesPage.html while the Debug app runs.
<h1 id="heading">Draft notes</h1>The example is the full program below: unzip it and dotnet run.
The heading becomes Draft notes without clearing the text you typed in Draft.
Full program
The zip contains a .NET 10 console project, Program.cs and NotesPage.html. If starting from a new console project, also install the template compiler:
dotnet add package RecursiveAI.OneUIThe OneUI package compiles NotesPage.html into the other half of the NotesPage partial class. Put both files next to the project file if building it by hand.
NotesPage.html starts with a heading and a text field:
<main style="padding: 24px"> <h1 id="heading">Notes</h1> <label for="note">Draft</label> <input id="note" /> </main>
Program.cs:
using OneApp; using var host = AppHost.Create(new AppOptions(new NotesPage()) { Title = "Notes", Width = 420, Height = 240, }); host.Run(); public partial class NotesPage { }
Start the app, type Call the editor in Draft, then save the heading change shown above. On Linux the same window stayed open, its heading read Draft notes, and Call the editor remained in the focused field. The terminal printed:
[oneapp reload] applied: template updated in placeIf a save introduces a markup error, the app keeps the last working screen and reports the error in the terminal; fix the line it names and save again.

Variations
Add a plain paragraph after the heading. As with the heading edit, this doesn’t need a new C# handler or expression:
<p>Keep this draft open.</p>Related recipes
The short answer
In a native OneApp Debug app, run the project and save the component’s .html file. You don’t have to stop and relaunch the app to change a label or add simple markup. The running process can apply a template that uses only expressions, handlers, and components it already knows about. That’s why the example changes what you see without discarding what you typed. A template that needs new C# code can’t use this path.
Does dotnet run hot reload a OneApp template?
Yes. In a Debug build, the app watches its own project files. The same native watcher works whether you start it from the terminal or an IDE. Edit the source file in the project directory, not a copy under bin or obj. Components in referenced projects don’t belong to that watcher; rebuild after changing one. If you copy the built app away from its sources, it has nothing to watch there.
What’s the difference between hot reload and a restart?
An in-place reload rebuilds the component’s UI nodes from the new template, not the application binary. The component keeps its state, focused element, typed text, and scroll positions. Keep the text field in the template if your goal is to try a new layout while preserving a draft.
An edit that introduces a handler or component the running build doesn’t know about needs a new build. A C# source edit also takes that path. After a successful build, the new process gets back text, number, and Boolean component state, as well as typed field text and focus; lists and other state are rebuilt by the new code. A build error leaves the old app running. See the hot reload docs for the full list of edits and what each does.
Why isn’t hot reload working when I save?
First, check that the app is running in Debug, not Release. The default Release build doesn’t include the watcher. In Debug, check whether ONEAPP_RELOAD is set to 0 or the project overrides OneAppHotReload to false. Then check that you saved a changed file inside the app’s own project. Saving unchanged text does nothing. If the heading still hasn’t changed, read the terminal: a parser or compiler diagnostic points to the edit that couldn’t be applied.