OpcSharp.Protocol 0.2.1

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

OpcSharp

CI NuGet Docs

A pure C# OPC UA client SDK with zero external OPC UA dependencies. Implements the OPC UA Binary Protocol from scratch.

Documentation: patdhlk.com/OpcSharp

Targets: netstandard2.0 · net8.0 · net9.0 · net10.0

Installation

dotnet add package OpcSharp.Client

Individual layers can be referenced separately if needed:

dotnet add package OpcSharp.Types
dotnet add package OpcSharp.Encoding
dotnet add package OpcSharp.Transport
dotnet add package OpcSharp.Transport.Http
dotnet add package OpcSharp.Security
dotnet add package OpcSharp.Protocol
dotnet add package OpcSharp.Services

Architecture

Layered stack where each layer depends only on layers below it:

OpcSharp.Client        ← High-level API, fluent builder, DI integration
OpcSharp.Services      ← Attribute, Browse, Method, Subscription, Discovery
OpcSharp.Protocol      ← Session + SecureChannel management
OpcSharp.Security      ← Security policies, crypto, certificates, user identity
OpcSharp.Transport.Http← HTTPS/WebSocket transport
OpcSharp.Transport     ← TCP transport, Hello/ACK, chunking
OpcSharp.Encoding      ← Binary encoder/decoder for all OPC UA types
OpcSharp.Types         ← NodeId, StatusCode, DataValue, Variant, etc.

Quick Start

var client = new OpcSharpClientBuilder()
    .WithEndpoint("opc.tcp://localhost:4840")
    .Build();

await client.ConnectAsync();

var results = await client.ReadAsync(new[]
{
    new ReadValueId
    {
        NodeId = new NodeId(0, 2258),
        AttributeId = AttributeIds.Value
    }
});

Console.WriteLine(results[0].Value);
await client.DisconnectAsync();

Security

Supported policies: None, Basic128Rsa15, Basic256, Basic256Sha256, Aes128_Sha256_RsaOaep, Aes256_Sha256_RsaPss, and ECC policies (NET8+).

User identity: Anonymous, UserName/Password, X509 Certificate, Issued Token (SAML/JWT).

CLI Tool

Explore and diagnose OPC UA servers from the command line:

dotnet tool install -g OpcSharp.Tool

opcsharp discover opc.tcp://localhost:4840
opcsharp browse opc.tcp://localhost:4840
opcsharp read opc.tcp://localhost:4840 -n "i=2258"
opcsharp health opc.tcp://localhost:4840

See the CLI documentation for the full command reference.

Build & Test

dotnet build OpcSharp.sln
dotnet test OpcSharp.sln

Integration tests require Docker:

docker compose -f docker/docker-compose.yml up -d
dotnet test tests/OpcSharp.Integration.Tests

License

See LICENSE for details.

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 was computed.  net48 was computed.  net481 was computed. 
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 (3)

Showing the top 3 NuGet packages that depend on OpcSharp.Protocol:

Package Downloads
OpcSharp.Services

OPC UA service layer (Read, Write, Browse, Subscribe) for OpcSharp

OpcSharp.Client

High-level OPC UA client with builder pattern and DI support for OpcSharp

OpcSharp.Transport.Http

OPC UA HTTPS transport layer for OpcSharp

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.2.1 35 3/13/2026
0.2.0 31 3/13/2026
0.1.2 29 3/12/2026
0.1.1 40 3/10/2026
0.1.0 32 3/10/2026