NetworkInspector.BaseApp.Desktop
0.23.0
dotnet add package NetworkInspector.BaseApp.Desktop --version 0.23.0
NuGet\Install-Package NetworkInspector.BaseApp.Desktop -Version 0.23.0
<PackageReference Include="NetworkInspector.BaseApp.Desktop" Version="0.23.0" />
<PackageVersion Include="NetworkInspector.BaseApp.Desktop" Version="0.23.0" />
<PackageReference Include="NetworkInspector.BaseApp.Desktop" />
paket add NetworkInspector.BaseApp.Desktop --version 0.23.0
#r "nuget: NetworkInspector.BaseApp.Desktop, 0.23.0"
#:package NetworkInspector.BaseApp.Desktop@0.23.0
#addin nuget:?package=NetworkInspector.BaseApp.Desktop&version=0.23.0
#tool nuget:?package=NetworkInspector.BaseApp.Desktop&version=0.23.0
NetworkInspector.BaseApp.Desktop
The same UI of an application on NetworkInspector.BaseApp in a desktop window: an Avalonia window with the operating system's WebView instead of the default browser.
Quickstart
BaseApplicationBuilder builder = BaseApplication.CreateBuilder(args, identity);
builder.UseDesktop();
return await builder.Build().RunAsync();
Start the application with --desktop. Without the flag it runs in the browser as before.
On Windows the executable needs an application manifest that lists the supported Windows versions (<ApplicationManifest> in
the project); without it Windows refuses the WebView's native child window and the first window ends the application with
Unable to create child window for native control host. The sample's
app.manifest is a complete one.
What the window does
- The main window starts maximized; closing it asks in the page what closing affects, then ends through
app.exit. - A detached widget opens in a desktop window of its own; closing that window returns the widget.
- External links open in the default browser; the window keeps the application's pages only. An application replaces that
handler by registering an
IExternalOpenerinbuilder.Services. - Browser keys (reload, find, back, zoom, print) and the WebView's own context menu do nothing; DevTools stay closed.
- Environment variables that would change the engine from outside the application are removed from the process before the first
window opens: every
WEBVIEW2_*variable (browser arguments such as a debugging port, the browser folder, the data folder, the release channel, the script debugger) and WebKit'sWEBKIT_INSPECTOR_SERVERandWEBKIT_INSPECTOR_HTTP_SERVER. Rendering workarounds such asWEBKIT_DISABLE_DMABUF_RENDERERstay. - Copy and paste use the system clipboard.
Platforms
| Platform | Engine | Install when missing |
|---|---|---|
| Windows | WebView2 | Microsoft Edge WebView2 Runtime |
| macOS | WKWebView | WebKit of macOS (part of the system) |
| Linux | WPE WebKit or WebKitGTK | WebKitGTK 4.1 (package libwebkit2gtk-4.1-0) |
Verified platforms: Windows x64 and Linux x64 (Ubuntu 24.04 under WSL 2); the others are built but not verified.
The WebView keeps its data in <application data>/<settings folder name>/webview, also when the run uses --settings-path.
Troubleshooting
Without a usable WebView the application continues in the default browser and the Messages page shows one Warning:
No usable WebView: install the <runtime>. <application> continues in the default browser.
DevTools are off in every window. All desktop runs of one application identity share the WebView data folder and its browser process: a second desktop run started while the first one runs joins that browser process, so run one desktop instance per identity (or give the second one another identity).
Build and test
dotnet build NetworkInspector.BaseApp.Desktop/NetworkInspector.BaseApp.Desktop.csproj -c Release
dotnet test --project NetworkInspector.BaseApp.Desktop.Tests/NetworkInspector.BaseApp.Desktop.Tests.csproj -c Release
The tests open no window: the shell runs on Avalonia's headless platform with a stand-in web view and an in-memory clipboard
(NetworkInspector.BaseApp.Desktop.Tests), and the page side of desktop mode runs in headless Edge
(NetworkInspector.BaseApp.UiTest, classes in Desktop/). The real WebView2 window is checked only in the release gate
(RealWebViewTests, see the repository README).
Documentation
Architecture § BaseApp.Desktop · Base app guide § Desktop window · NetworkInspector.BaseApp · Changelog
License
MIT; see LICENSE. Avalonia and the WebView package are MIT; the licenses on the sample's About page list every shipped package.
| 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
- Avalonia (>= 12.1.6)
- Avalonia.Controls.WebView (>= 12.1.2)
- Avalonia.Desktop (>= 12.1.6)
- InvariantStringHelper (>= 1.0.0)
- ModelContextProtocol.AspNetCore (>= 2.4.0)
- NetworkInspector.BaseApp (>= 0.23.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 |
|---|---|---|
| 0.23.0 | 0 | 11/26/2026 |