Managed wrapper for the WinUSB APIs on Microsoft Windows.
The package includes assets for .NET Standard 2.0, .NET 6/7/8/10 (Windows), and .NET Framework 4.7.2/4.8. Referencing it
from a generic TFM such as net10.0 selects the .NET Standard 2.0 compatibility asset and avoids NU1701. Runtime use
is still Windows-only: invoking WinUSB APIs outside Windows is unsupported and will fail.
.NET Framework 4.7.2 or later is the recommended Framework target. .NET Framework 4.7.1 can consume the .NET Standard 2.0 asset, but is not a first-class supported runtime.
This is a fork of the fantastic
WinUSBNetproject by Thomas Bleeker and contributors.
- Replaced P/Invoke code with source generators
- Changed namespace to
Nefarius.Drivers.WinUSBto avoid conflicts with the origin library - Removed device notification listener as my other
lib
Nefarius.Utilities.DeviceManagementprovides a drop-in replacement without depending on WinForms or WPF - Added
USBDevice::GetSingleDeviceByPathto allow opening a WinUSB device via device path (symbolic link)
dotnet build -c:Releasedotnet tool install -g Nefarius.Tools.XMLDoc2Markdownxmldoc2md .\bin\net8.0-windows\Nefarius.Drivers.WinUSB.dll .\docs\
- Migrate all buffers to Spans where possible
- More/better tests 😇
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
