NativeWebHost 2.0.0

dotnet add package NativeWebHost --version 2.0.0
                    
NuGet\Install-Package NativeWebHost -Version 2.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="NativeWebHost" Version="2.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NativeWebHost" Version="2.0.0" />
                    
Directory.Packages.props
<PackageReference Include="NativeWebHost" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add NativeWebHost --version 2.0.0
                    
#r "nuget: NativeWebHost, 2.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package NativeWebHost@2.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=NativeWebHost&version=2.0.0
                    
Install as a Cake Addin
#tool nuget:?package=NativeWebHost&version=2.0.0
                    
Install as a Cake Tool

NativeWebHost

A .NET desktop WebView host focused on native OS shells.

NuGet License: MIT Build

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(...) and nativeWeb.on(...) JavaScript bridge
  • app://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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on NativeWebHost:

Package Downloads
NativeWebHost.Windows

Windows runtime and native WebView2 adapter for NativeWebHost.

NativeWebHost.Linux

Linux GTK runtime and WebKitGTK adapter for NativeWebHost.

NativeWebHost.Mac

macOS AppKit runtime and WKWebView adapter for NativeWebHost.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.0 62 5/18/2026