CsWebUi.Native
2.5.0-beta.4.5
See the version list below for details.
dotnet add package CsWebUi.Native --version 2.5.0-beta.4.5
NuGet\Install-Package CsWebUi.Native -Version 2.5.0-beta.4.5
<PackageReference Include="CsWebUi.Native" Version="2.5.0-beta.4.5" />
<PackageVersion Include="CsWebUi.Native" Version="2.5.0-beta.4.5" />
<PackageReference Include="CsWebUi.Native" />
paket add CsWebUi.Native --version 2.5.0-beta.4.5
#r "nuget: CsWebUi.Native, 2.5.0-beta.4.5"
#:package CsWebUi.Native@2.5.0-beta.4.5
#addin nuget:?package=CsWebUi.Native&version=2.5.0-beta.4.5&prerelease
#tool nuget:?package=CsWebUi.Native&version=2.5.0-beta.4.5&prerelease
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);
}
}
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
- Repository documentation
- NativeAOT smoke example
- WebUI C API documentation
- Report an issue or request support
CS-WebUI is MIT licensed. See the license and WebUI notices for bundled-component terms.
| 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
- 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 |