WaylandDotnet.Scanner 0.7.0

dotnet tool install --global WaylandDotnet.Scanner --version 0.7.0
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local WaylandDotnet.Scanner --version 0.7.0
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=WaylandDotnet.Scanner&version=0.7.0
                    
nuke :add-package WaylandDotnet.Scanner --version 0.7.0
                    

WaylandDotnet.Scanner

A .NET 10 tool that generates C# bindings from Wayland XML protocol files.

Contributing to the WaylandDotnet repo: see ../CONTRIBUTING.md. The repo entry point is protocols.json.

Installation

dotnet tool install --global WaylandDotnet.Scanner

Quick Start

# Create a protocols.json configuration file
wayland-dotnet-scanner init

# Edit protocols.json to add your protocols, then generate code
wayland-dotnet-scanner

Configuration (protocols.json)

{
  "OutputRoot": "./Generated",
  "DocsDir": "./docs",
  "Protocols": [
    {
      "Name": "Wayland",
      "XmlFile": "protocols/wayland.xml",
      "Namespace": "Core"
    },
    {
      "Name": "XDG Shell",
      "XmlFile": "protocols/xdg-shell.xml",
      "Namespace": "Stable",
      "SourceUrl": "https://gitlab.freedesktop.org/wayland/wayland-protocols/-/raw/main/stable/xdg-shell/xdg-shell.xml"
    }
  ]
}

SourceUrl is optional. When set, wayland-dotnet-scanner download (or just download from the repo root) fetches the XML into XmlFile.

CLI Commands

# Create default protocols.json
wayland-dotnet-scanner init

# Generate from protocols.json (auto-detected in current directory)
wayland-dotnet-scanner

# Generate from specific config file
wayland-dotnet-scanner ./my-protocols.json

# Generate from a single XML file
wayland-dotnet-scanner protocol.xml ./Output --namespace MyNamespace --name "My Protocol"

# List protocols in config
wayland-dotnet-scanner list

# Download protocol XML files (entries with SourceUrl)
wayland-dotnet-scanner download

# Show help
wayland-dotnet-scanner --help

Finding Protocol XML Files

  • wayland.app/protocols - Links to official Wayland protocols
  • /usr/share/wayland-protocols/ - System-installed stable protocols
  • Compositor-specific protocols (wlroots, River, Hyprland, etc.)

Generated Output

For each protocol, the scanner generates:

  • {Namespace}/{ProtocolName}/Protocol.cs - Main protocol classes
  • {Namespace}/{ProtocolName}/Copyright.txt - Protocol copyright info

When DocsDir is set, also generates:

  • Updates the protocols section in docs/sidebar.md (between `` markers)

Features

  • Generates type-safe C# bindings from Wayland XML protocols
  • C# events instead of C callbacks
  • Nullable reference types support
  • Namespace organization for protocol categories
  • Optional documentation generation

Requirements

  • .NET 10.0 SDK
  • Wayland XML protocol files
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.

This package has no dependencies.

Version Downloads Last Updated
0.7.0 92 10/16/2026
0.6.0 130 9/4/2026
0.5.1 155 6/12/2026
0.5.0 141 5/24/2026
0.4.0 153 3/17/2026
0.3.0 151 3/12/2026
0.2.0 138 3/2/2026
0.1.0 131 2/21/2026