Vixen
02b45cc4
csharp
public static class MetadataUpdate

The .NET runtime's hot-reload callback: what dotnet watch calls once it has replaced a method body in the running process.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

This is the other half of the markup channel, and the half that is not ours. Editing a .vxml regenerates a C# file, which changes Build, which the runtime delivers here — and only then is there anything new to run. A watcher over .vxml could see the edit sooner and do nothing useful with it.

⚠ Hosts are held weakly. A static list of every document ever created is a leak with a development-only cause and a production-shaped consequence, and the handler has no idea when a window closes. A collected host simply stops being reloaded.

Methods (4)

  • public static void Register(HotReloadHost host)

    Registers a host to be reloaded when the runtime updates the application.

  • public static bool Unregister(HotReloadHost host)

    Stops reloading a host.

  • public static void ClearCache(Type[]? types)

    Called by the runtime before an update is applied.

  • public static void UpdateApplication(Type[]? types)

    Called by the runtime after an update is applied.

Used by (2)

  • HotReloadTestsVixen.Ui.HotReload.Tests
  • EditorApplicationVixen.Editor.App