Runic.Desktop
0.11.0
See the version list below for details.
dotnet add package Runic.Desktop --version 0.11.0
NuGet\Install-Package Runic.Desktop -Version 0.11.0
<PackageReference Include="Runic.Desktop" Version="0.11.0" />
<PackageVersion Include="Runic.Desktop" Version="0.11.0" />
<PackageReference Include="Runic.Desktop" />
paket add Runic.Desktop --version 0.11.0
#r "nuget: Runic.Desktop, 0.11.0"
#:package Runic.Desktop@0.11.0
#addin nuget:?package=Runic.Desktop&version=0.11.0
#tool nuget:?package=Runic.Desktop&version=0.11.0
Runic Desktop
Runic Desktop is a managed .NET runtime for web-powered desktop applications.
It serves application content with ASP.NET Core, carries the connection between
the page and .NET, and opens the interface in an installed browser or an
embedded platform WebView. For calls between JavaScript and .NET, use
Runic Windows and Views
(Runic.Application.Views.Desktop), whose Bridge runs on Runic Desktop. It does not load the native WebUI library.
Source preview · first package pending. The API may change before the first published preview.
Capabilities
- Embedded HTML, files, folders, external URLs, and fixed or streaming virtual content
- Authenticated page connections, connection events and a connected-page count
- Managed-to-JavaScript script execution with a size-checked result
- Shared or isolated Kestrel listeners with explicit host and surface ownership
- Request-scoped dependency injection, streaming backpressure, and cancellation causes
- Same-origin admission and 256-bit surface-scoped session credentials by default
- Installed-browser discovery, isolated profiles, kiosk mode, and process ownership
- Embedded WebView2, WKWebView, and WebKitGTK windows
- Structured browser/WebView preflight with actionable prerequisite diagnostics
- Sensitive permissions denied by default and explicit, typed presentation opt-in
- Window geometry, framing, transparency, visibility, focus, and native handles
- Asynchronous native close confirmation for unsaved work
- Trimming and NativeAOT-compatible managed core
Example
using Runic.Desktop;
await using var host = await DesktopHost.StartAsync(new DesktopHostOptions
{
// Windows uses WebView2 and macOS WKWebView; Linux selects a toolkit explicitly.
Linux = new() { EmbeddedBackend = LinuxEmbeddedBackend.Gtk3WebKit41 },
});
await using var surface = await host.CreateSurfaceAsync(new DesktopSurfaceOptions
{
Content = new DesktopContent.Html("""
<!doctype html>
<html>
<head><script src="webui.js"></script><title>Runic</title></head>
<body><h1>Hello from Runic Desktop</h1></body>
</html>
"""),
});
await using var window = await surface.OpenWindowAsync();
using var timeout = new CancellationTokenSource(TimeSpan.FromSeconds(10));
Console.WriteLine(await surface.ExecuteJavaScriptAsync("return document.title;", timeout.Token));
await window.WaitForCloseAsync();
Run the included sample from source:
dotnet run --project samples/Runic.Desktop.Sample
dotnet run --project samples/Runic.Desktop.Sample -- --webview
Platform WebViews
- Windows uses the Microsoft Edge WebView2 Runtime.
Windows x64/ARM64 NativeAOT publishes link the WebView2 loader into the
executable automatically; no adjacent
WebView2Loader.dllis required. The Edge runtime must still be installed. JIT builds retain the native DLL. - macOS uses the system WebKit framework.
- Linux requires explicit
DesktopHostOptions.Linux.EmbeddedBackendselection: GTK3/WebKitGTK 4.1, or the optionalRunic.Desktop.Gtk4provider with GTK4/WebKitGTK 6.0, plus a graphical display.
WebKit does not report a list without list markers, such as every list on a
Tailwind page, as a list to a screen reader; add role="list" to it. See
accessibility.
Applications can provide an IDesktopWindowHostFactory in immutable host
options without replacing the managed server, transport, capabilities, or
lifecycle; see
custom window hosts.
No API of this package is experimental.
Windows open in the embedded WebView unless DesktopWindowOptions.Browser
selects an installed browser. Check a window request at startup, before doing
application work:
var windowOptions = new DesktopWindowOptions
{
PresentationPolicy = DesktopPresentationPolicy.EmbeddedThenBrowser,
Width = 1000,
Height = 700,
};
var validation = host.Validate(windowOptions);
foreach (var warning in validation.Warnings)
{
Console.Error.WriteLine($"{warning.Code} ({warning.Option}): {warning.Message}");
}
validation.ThrowIfInvalid();
Validate reports a missing WebView runtime, browser or Linux toolkit, every
window option the selected host rejects or ignores, and how permission grants
apply, each with a stable code and remediation, without starting a
presentation. It logs the diagnostics through DesktopHostOptions.LoggerFactory.
ThrowIfInvalid throws a DesktopConfigurationException that lists the
errors; warnings name options the presentation ignores. GetPresentationPreflight
returns the same checks as typed results.
Before a host exists, DesktopPlatform.GetAvailability(options) reports the
browsers and the embedded presentation of the options you will start with,
including a GTK 4 or other custom window host.
The default RequestedOnly policy never changes presentation mode. Applications
that deliberately prefer a WebView but can continue in a browser can select
DesktopPresentationPolicy.EmbeddedThenBrowser; the resulting
DesktopWindow.IsFallback property and the diagnostic sink make that decision
observable. Camera and microphone access remains denied unless
DesktopPermissionGrant.MediaCapture is explicitly selected for the window.
WebView2, WebKitGTK and GTK4 windows grant it only to the presented origin;
WKWebView windows and Firefox ask the user instead, and an explicitly selected
Chromium-based browser accepts capture for every origin it opens. A browser
fallback opens without the grant.
The retained webui-compat/52f9e75 direct-capability profile cannot carry a
structured invocation failure on its legacy wire response. It reports only the
stable empty compatibility result while the host emits a redacted,
correlation-bearing diagnostic. Runic Application Views hosted through
Runic.Application.Views.Desktop report their own typed, redacted, correlation-bearing errors.
Troubleshooting
Run dotnet runic doctor in the project, with --rid for a target machine,
to list the native runtime it needs. At startup, host.Validate(windowOptions)
reports each missing prerequisite with a stable code and remediation:
webview2-runtime-missing(Windows). Install the Microsoft Edge WebView2 Runtime on the machine. NativeAOT publishes need noWebView2Loader.dll.linux-embedded-backend-not-selected. SetDesktopHostOptions.Linux.EmbeddedBackend, as in the example above. No toolkit is selected by default.webkitgtk-runtime-missing,gtk4-runtime-missingorwebkitgtk6-runtime-missing(Linux). Install GTK 3 and WebKitGTK 4.1, or GTK 4.12 or newer and WebKitGTK 6.0 forRunic.Desktop.Gtk4, and run in a graphical session.gtk4-provider-missing. A GTK4 backend needs theRunic.Desktop.Gtk4package and its main-thread entry point.- GTK 3 loaded in a GTK 4 process. A process cannot change GTK versions
after claiming a backend, and a GTK 4 process must not load GTK 3. Replace
Runic.Platform.LinuxwithRunic.Platform.Linux.Gtk4in a GTK4 application; doctor'sgtk4-profilecheck lists what is missing.
Relationship to WebUI and CS-WebUI
Runic Desktop began as a behavioral port of WebUI. WebUI remains a compatibility oracle for its established window, bridge, binding, content, and lifecycle behavior, while Runic Desktop owns its implementation and public API.
CS-WebUI remains the independently maintained .NET binding for unmodified upstream WebUI. Runic Desktop has no production dependency on CS-WebUI or the WebUI native library.
The internal WebUI-profile engine remains differential evidence; it is not part of the public API. Existing source-preview consumers can use the migration guide. The wire profile documents the compatibility boundary.
Product contract
Runic Desktop implements the language-neutral Runic Desktop presentation contract. The contract defines host, surface, window, session, request, streaming, cancellation, security, and error semantics independently of .NET and TypeScript APIs. Its ownership map keeps Runic Application Views, Assets, Translations, Vite, and framework responsibilities with their existing Runic products.
License and attribution
Runic Desktop is MIT licensed. Its managed bridge implementation is informed by
WebUI's MIT-licensed wire protocol and TypeScript bridge. The upstream license
is retained in eng/licenses/WebUI-LICENSE.txt and the relevant attribution is
recorded in NOTICE.
Minimal hosting profile
Set RunicDesktopMinimalHost=true to use the opt-in empty ASP.NET Core builder
with explicit Kestrel core and socket transport. A NativeAOT linker feature switch
removes the default slim-builder path. Runic's surface, transport and admission
behavior is retained; default configuration providers are omitted. Test any custom
service assumptions. See the SDK's size and tuning guide.
Any value other than true or false fails the build with
RUNICDESK001.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Microsoft.Web.WebView2 (>= 1.0.4258.31)
- Runic.Platform (= 0.11.0)
- Runic.Platform.Linux.DBus (= 0.11.0)
- Tmds.DBus.Protocol (>= 0.95.1)
NuGet packages (4)
Showing the top 4 NuGet packages that depend on Runic.Desktop:
| Package | Downloads |
|---|---|
|
Runic.Desktop.Gtk4
Explicit GTK 4 and WebKitGTK 6 embedded presentation provider for Runic Desktop. |
|
|
Runic.Application.Views.Desktop
Runic Window and View host adapter for Runic Desktop. |
|
|
Runic.Assets.Desktop
Request-scoped Runic Desktop delivery for Runic Assets. |
|
|
Runic.Application.Desktop
Runic Window and View host adapter for Runic Desktop. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.12.1 | 0 | 10/27/2026 |
| 0.12.0 | 0 | 10/27/2026 |
| 0.11.0 | 2,482 | 10/25/2026 |
| 0.10.0 | 5,433 | 10/22/2026 |
| 0.9.1 | 884 | 10/21/2026 |
| 0.9.0 | 214 | 10/21/2026 |
| 0.8.0-preview.6 | 1,379 | 10/19/2026 |
| 0.8.0-preview.5 | 408 | 10/17/2026 |
| 0.8.0-preview.4 | 1,002 | 10/17/2026 |
| 0.8.0-preview.3 | 901 | 10/15/2026 |
| 0.8.0-preview.2 | 148 | 10/15/2026 |
| 0.8.0-preview.1 | 200 | 10/15/2026 |
| 0.7.0-preview.9 | 599 | 10/14/2026 |
| 0.7.0-preview.8 | 118 | 10/12/2026 |
| 0.7.0-preview.7 | 70 | 10/12/2026 |
| 0.7.0-preview.6 | 635 | 10/9/2026 |
| 0.7.0-preview.5 | 187 | 10/9/2026 |
| 0.7.0-preview.4 | 99 | 10/8/2026 |
| 0.7.0-preview.3 | 88 | 10/8/2026 |
| 0.7.0-preview.2 | 107 | 10/7/2026 |