BlackSharp.IO.Ports 1.2.2

Prefix Reserved
dotnet add package BlackSharp.IO.Ports --version 1.2.2
                    
NuGet\Install-Package BlackSharp.IO.Ports -Version 1.2.2
                    
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="BlackSharp.IO.Ports" Version="1.2.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="BlackSharp.IO.Ports" Version="1.2.2" />
                    
Directory.Packages.props
<PackageReference Include="BlackSharp.IO.Ports" />
                    
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 BlackSharp.IO.Ports --version 1.2.2
                    
#r "nuget: BlackSharp.IO.Ports, 1.2.2"
                    
#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 BlackSharp.IO.Ports@1.2.2
                    
#: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=BlackSharp.IO.Ports&version=1.2.2
                    
Install as a Cake Addin
#tool nuget:?package=BlackSharp.IO.Ports&version=1.2.2
                    
Install as a Cake Tool

<h1 align="center">BlackSharp</h1>

Windows Linux Build .NET Framework .NET GitHub Sponsors PayPal License

Reusable .NET building blocks for application logic, device communication and desktop interfaces.

BlackSharp brings commonly needed functionality into a set of focused libraries: core utilities, USB HID communication, native serial and raw USB access, MVVM helpers and Avalonia controls. Share proven building blocks across applications without copying infrastructure code into every project.

The libraries are general-purpose components.

Key capabilities

  • Everyday utilities for collections, strings, files, byte and bit operations, unit conversions, reflection, logging, asynchronous work & more
  • USB HID communication with device discovery, report metadata and cancellable worker-based I/O on Windows and Linux
  • Native serial and raw USB access with configurable timeouts, flow control, device discovery and platform-specific transports
  • MVVM foundations built on CommunityToolkit.Mvvm, including view-model bases, drag-and-drop contracts and shared dialog models
  • Avalonia desktop components including dialogs, numeric text boxes, busy indicators, reorderable controls, behaviors, converters and shared styles
  • Modular dependencies so utility and device-access consumers do not need to bring in a desktop UI framework

Choosing a package

Install the required packages through your IDE's NuGet package manager.

Start with BlackSharp.Core for shared application utilities.

Add BlackSharp.IO.HID for HID devices or BlackSharp.IO.Ports for serial and raw USB communication.

Use BlackSharp.MVVM for view-model infrastructure and BlackSharp.UI.Avalonia for the Avalonia integration.

Projects

Project NuGet package Downloads Purpose
BlackSharp.Core NuGet Downloads General-purpose utilities, conversions, collections, logging and native interop helpers
BlackSharp.IO.HID NuGet Downloads USB HID discovery, report handling and device streams
BlackSharp.IO.Ports NuGet Downloads Native serial communication and raw USB device access
BlackSharp.MVVM NuGet Downloads View-model bases and shared MVVM contracts
BlackSharp.UI.Avalonia NuGet Downloads Avalonia controls, dialogs, behaviors, styles and desktop integration

Supported .NET versions

Target Core, IO.HID and IO.Ports MVVM and UI.Avalonia
.NET Framework 4.7.2 ✅ ❌
.NET Framework 4.8.1 ✅ ❌
.NET Standard 2.0 ✅ ❌
.NET 8 ✅ ✅
.NET 9 ✅ ✅
.NET 10 ✅ ✅

Quick start

Core utilities

Reference BlackSharp.Core to use shared helpers without any UI or device-transport dependencies:

using System;
using BlackSharp.Core.Converters;
using BlackSharp.Core.Converters.Enums;

var mebibytes = DataUnitConverter.Convert(1048576m, DataUnit.Byte, DataUnit.MebiByte);

Console.WriteLine($"{mebibytes} MiB");

HID discovery

Reference BlackSharp.IO.HID to enumerate HID interfaces on Windows or Linux:

using System;
using BlackSharp.IO.HID;

foreach (var device in HIDDeviceEnumerator.GetDevices())
{
    Console.WriteLine($"{device.VendorID:X4}:{device.ProductID:X4} {device.ProductName}");
}

Open a selected interface through HIDDevice.Open() or TryOpen() when your application is ready to communicate and dispose the returned stream when finished. Device-specific report formats still need to be implemented by the consumer.

Versioning

Versions/BLACKSHARP.VERSION is the single authoritative version for the five NuGet packages and the projects that produce them. Change only this file to prepare the next version; individual project files do not carry separate release numbers.

Use packages from the same BlackSharp release together.

Troubleshooting and support

For device-access failures, check permissions, the installed device driver, native dependencies and whether another application is using the device. For UI issues, distinguish a reusable BlackSharp component from the Avalonia backend and application-specific resource configuration.

When opening a GitHub issue, include the affected package and version, target framework, operating system, architecture, a minimal reproduction and the complete exception. For device issues, include relevant device identifiers and transport settings; remove serial numbers, credentials and other sensitive data before posting.

Contributing

Everyone is welcome and encouraged to contribute. Bug reports, documentation, tests, fixes and additional reusable components are all valuable. Keep changes focused and follow the existing architecture, naming, documentation, formatting and code style. Include or update tests and documentation where applicable, and describe the affected packages, platforms and validation in the pull request.

AI-assisted contributions

Transparency about the use of artificial intelligence is required. Changes created entirely by AI must be clearly marked as AI-generated in the pull request description. Changes to which an AI tool contributed must likewise be marked as AI-assisted, even when they were subsequently reviewed or edited by the contributor. The disclosure should identify the affected parts of the change. Contributors remain responsible for understanding, reviewing and testing their submissions, as well as for their correctness, security and license compliance.

AI tools have supported the development of this project, including documentation and unit testing.

License

Licensed under the Mozilla Public License 2.0.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 is compatible.  net48 was computed.  net481 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos 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
1.2.2 99 9/23/2026
1.2.1 127 9/14/2026
1.2.0 131 8/21/2026
1.1.4 140 7/23/2026
1.1.3 126 7/19/2026
1.1.2 131 6/14/2026
1.1.1 134 5/22/2026
1.1.0 135 5/9/2026