CsWebUi.Native 2.5.0-beta.4.8

This is a prerelease version of CsWebUi.Native.
dotnet add package CsWebUi.Native --version 2.5.0-beta.4.8
                    
NuGet\Install-Package CsWebUi.Native -Version 2.5.0-beta.4.8
                    
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="CsWebUi.Native" Version="2.5.0-beta.4.8" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CsWebUi.Native" Version="2.5.0-beta.4.8" />
                    
Directory.Packages.props
<PackageReference Include="CsWebUi.Native" />
                    
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 CsWebUi.Native --version 2.5.0-beta.4.8
                    
#r "nuget: CsWebUi.Native, 2.5.0-beta.4.8"
                    
#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 CsWebUi.Native@2.5.0-beta.4.8
                    
#: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=CsWebUi.Native&version=2.5.0-beta.4.8&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=CsWebUi.Native&version=2.5.0-beta.4.8&prerelease
                    
Install as a Cake Tool

CS-WebUI Native

Use the complete WebUI C ABI from .NET when you need exact native control. CsWebUi.Native provides NativeAOT-compatible, allocation-free LibraryImport bindings while retaining the C API's pointer, lifetime, and callback responsibilities.

Install

dotnet add package CsWebUi.Native --prerelease

CsWebUi.Native targets .NET 10 and is currently a prerelease package following the WebUI 2.5 beta ABI. Release packages include verified official WebUI native libraries for win-x64, linux-x64, linux-arm64, osx-x64, and osx-arm64.

Browser mode needs a supported installed browser. Embedded-WebView mode needs WebView2 on Windows, WebKitGTK on Linux, or WebKit on macOS. Your project must enable unsafe code because the ABI exposes pointers and unmanaged function pointers:

<PropertyGroup>
  <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>

First window

using System;
using CsWebUi.Native;

unsafe
{
    var window = WebUiNative.NewWindow();
    ReadOnlySpan<byte> page = "<h1>Hello from CS-WebUI Native</h1>\0"u8;

    try
    {
        fixed (byte* content = page)
        {
            if (WebUiNative.Show(window, content) == 0)
            {
                throw new InvalidOperationException("WebUI could not show the page.");
            }
        }

        WebUiNative.Wait();
    }
    finally
    {
        WebUiNative.Destroy(window);
    }
}

Every byte* string parameter must point to null-terminated UTF-8: WebUI reads it with strlen. The span of a "..."u8 literal excludes the terminator the compiler places after it, and a slice of any buffer is not terminated, so include \0 in the literal as above or copy the bytes into a terminated buffer. An embedded null character ends the string early. Length-based parameters, such as SendRaw's size, must match the buffer.

WebUI owns pointers it returns unless the upstream API explicitly requires WebUiNative.Free. Keep callbacks and any memory passed across the ABI valid for the lifetime WebUI requires; this package intentionally does not add the ownership and UTF-8 safety layer.

Choose this package

Use CsWebUi.Native for direct C-ABI integrations, custom callback/function pointer handling, or when a NativeAOT-friendly low-level binding is required. For window ownership, managed event arguments, synchronous or asynchronous callbacks, and high-level file handling, install CsWebUi instead.

For Windows win-x64 NativeAOT publishing, CsWebUiStaticLink=true links the WebUI and WebView2 loader libraries into the executable. It is opt-in, only supports win-x64, and bypasses CSWEBUI_NATIVE_LIBRARY and WebUiNativeLibrary.SetLibraryPath. Otherwise, set a custom native library path before the first WebUiNative call when overriding the bundled asset.

Learn and get help

CS-WebUI is MIT licensed. See the license and WebUI notices for bundled-component terms.

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 CsWebUi.Native:

Package Downloads
CsWebUi

Safe, ergonomic .NET 10 window and callback abstractions for WebUI.

Runic.Application.Views.CsWebUi

CS-WebUI host adapter for Runic Window and View applications.

Runic.Application.CsWebUi

CS-WebUI host adapter for Runic Window and View applications.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.5.0-beta.4.8 4,484 10/23/2026
2.5.0-beta.4.7 5,745 10/14/2026
2.5.0-beta.4.6 5,310 10/5/2026
2.5.0-beta.4.5 880 9/22/2026
2.5.0-beta.4.4 1,740 8/7/2026
2.5.0-beta.4.3 505 7/24/2026
2.5.0-beta.4.2 94 7/16/2026
2.5.0-beta.4.1 93 7/12/2026