using Lilith.RazorWebGui;namespace Lilith.DesktopWeb2App;internal static class Program{ [STAThread] private static void Main(string[] args) { ApplicationConfiguration.Initialize(); int port = TcpPort.FindFree(); string url = $"http://localhost:5051"; string[] webArgs = ["--urls", url, ..args]; using var ready = new ManualResetEventSlim(false); var hostTask = Task.Run(() => { var app = LilithWebApplication.Build(webArgs); app.Lifetime.ApplicationStarted.Register(() => ready.Set()); app.Run(); }); if (!ready.Wait(TimeSpan.FromSeconds(60))) { MessageBox.Show("Lilith web host failed to start.", "Lilith Desktop", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } Application.Run(new MainForm(url)); }}
Documentation
Lilith.DesktopWeb2App (Version 6)
Windows desktop shell (WebView2 + local Kestrel) hosting Lilith.RazorWebGui for Version 6.
dotnet run --project Lilith.DesktopWeb2App.csproj
Requires [WebView2 Runtime](https://developer.microsoft.com/microsoft-edge/webview2/).