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
                    
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="NetworkInspector.BaseApp.Desktop" Version="0.23.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NetworkInspector.BaseApp.Desktop" Version="0.23.0" />
                    
Directory.Packages.props
<PackageReference Include="NetworkInspector.BaseApp.Desktop" />
                    
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 NetworkInspector.BaseApp.Desktop --version 0.23.0
                    
#r "nuget: NetworkInspector.BaseApp.Desktop, 0.23.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 NetworkInspector.BaseApp.Desktop@0.23.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=NetworkInspector.BaseApp.Desktop&version=0.23.0
                    
Install as a Cake Addin
#tool nuget:?package=NetworkInspector.BaseApp.Desktop&version=0.23.0
                    
Install as a Cake Tool

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 IExternalOpener in builder.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's WEBKIT_INSPECTOR_SERVER and WEBKIT_INSPECTOR_HTTP_SERVER. Rendering workarounds such as WEBKIT_DISABLE_DMABUF_RENDERER stay.
  • 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 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.

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