NativeWebHost.Linux
2.0.0
dotnet add package NativeWebHost.Linux --version 2.0.0
NuGet\Install-Package NativeWebHost.Linux -Version 2.0.0
<PackageReference Include="NativeWebHost.Linux" Version="2.0.0" />
<PackageVersion Include="NativeWebHost.Linux" Version="2.0.0" />
<PackageReference Include="NativeWebHost.Linux" />
paket add NativeWebHost.Linux --version 2.0.0
#r "nuget: NativeWebHost.Linux, 2.0.0"
#:package NativeWebHost.Linux@2.0.0
#addin nuget:?package=NativeWebHost.Linux&version=2.0.0
#tool nuget:?package=NativeWebHost.Linux&version=2.0.0
NativeWebHost
A .NET desktop WebView host focused on native OS shells.
NativeWebHost lets a .NET application host a web UI inside a native desktop window. The project now keeps one native path per operating system instead of carrying multiple UI-framework-specific shells.
Platform Strategy
| OS | Window runtime | WebView adapter | Status |
|---|---|---|---|
| Windows | raw Win32 in NativeWebHost.Windows |
WebView2 in NativeWebHost.Windows |
Primary path |
| Linux | GTK 3 in NativeWebHost.Linux |
WebKitGTK in NativeWebHost.Linux |
Experimental |
| macOS | AppKit in NativeWebHost.Mac |
WKWebView in NativeWebHost.Mac |
Planned |
Removed paths: NativeWebHost.WinForms, NativeWebHost.WebView2, and NativeWebHost.Cef. The Windows path is now raw Win32 plus WebView2Aot-based native WebView2, with no WinForms or WPF dependency.
The packaging goal is that end users do not install extra frameworks manually. Windows uses the OS WebView2 runtime or an app-packaged fixed WebView2 runtime. macOS uses system WebKit. Linux should package the needed GTK/WebKitGTK native libraries with the app image/package.
Quick Start
using NativeWebHost;
using NativeWebHost.Windows;
var app = NativeWebApp.CreateBuilder(args)
.Configure(o =>
{
o.Title = "My App";
o.CustomScheme = "app";
o.ContentRootPath = Path.Combine(AppContext.BaseDirectory, "wwwroot");
o.StartUrl = "app://localhost/index.html";
o.Width = 1280;
o.Height = 800;
})
.UseAdapter(new NativeWebView2AdapterFactory())
.UseRuntime(new Win32Runtime())
.Build();
await app.RunAsync();
NativeWebHost.Windows supports app://localhost/... local assets, JavaScript bridge injection, custom window chrome helpers, and built-in title-bar presets.
Linux uses the same app code shape with GtkRuntime and WebKitGtkAdapterFactory from NativeWebHost.Linux. See samples/NativeWebHost.Sample.CrossPlatform for the platform switch.
Features
- Native host windows with shared runtime/adapter abstractions
nativeWeb.invoke(...)andnativeWeb.on(...)JavaScript bridgeapp://localhost/...local asset loading- Multi-window startup and dynamic window management
- Splash windows
- Window style presets such as normal, frameless, DWM blur glass, and VS Code-style chrome where the OS runtime supports them
- ASP.NET Core, Blazor, Vue SPA, and static asset hosting examples
Documentation
| Document | Description |
|---|---|
| Getting Started | Installation and first app |
| Architecture | Component design and boundaries |
| JS Bridge | C# to JavaScript messaging |
| Adapters | Browser engine adapters |
| Migration Guide | Upgrade notes |
| Roadmap | Release plan |
License
MIT - see LICENSE.
| 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
- NativeWebHost (>= 2.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.0.0 | 49 | 5/18/2026 |