WinUSBNet is a .NET class library that provides easy access to the WinUSB API from C#, VB.NET and other .NET languages.


Keywords
USB, WinUSB
License
MIT
Install
Install-Package Nefarius.Drivers.WinUSB -Version 4.1.71

Documentation

Nefarius.Drivers.WinUSB

.NET .NET 4.7.2 .NET 4.8 .NET 6/7/8 NuGet Version NuGet

Managed wrapper for the WinUSB APIs on Microsoft Windows.

This is a fork of the fantastic WinUSBNet project by Thomas Bleeker and contributors.

Changes of this fork

  • Replaced P/Invoke code with source generators
  • Changed namespace to Nefarius.Drivers.WinUSB to avoid conflicts with the origin library
  • Removed device notification listener as my other lib Nefarius.Utilities.DeviceManagement provides a drop-in replacement without depending on WinForms or WPF
  • Added USBDevice::GetSingleDeviceByPath to allow opening a WinUSB device via device path (symbolic link)

Documentation

Link to API docs.

Generating documentation

  • dotnet build -c:Release
  • dotnet tool install -g Nefarius.Tools.XMLDoc2Markdown
  • xmldoc2md .\bin\net8.0-windows\Nefarius.Drivers.WinUSB.dll .\docs\

TO-DOs

  • Migrate all buffers to Spans where possible
  • More/better tests 😇

Features

Taken verbatim from the source repository.

  • MIT licensed with C# source code available (free for both personal and commercial use)
  • CLS compliant library (usable from all .NET languages such as C#, VB.NET and C++.NET)
  • Synchronous and asynchronous data transfers
  • Support for 32-bit and 64-bit Windows versions
  • Support for multiple interfaces and endpoints
  • Intellisense documentation

Related documentation