# Description _Describe the changes here to communicate to the maintainers why they should accept this pull request. By default - this will become the Commit message after merging and thus define history._ Add provider-backed MachineTool, bundled WMTP, GMS and CranesHoists companions using the existing Machinery/MachineVision fluent, DI and typed-client approach. **The PR is open/non-draft by user choice. Current head `ecc4a7d6ca3e8004cf28ab54da605da302d026bf` is mergeable and has 108 successful checks, six intentionally skipped checks, zero failures and zero pending checks. All five primary workflows completed successfully at that exact head.** | Family | Released specification/model | Packaging | | --- | --- | --- | | MachineTool | OPC 40501-1, 1.02.0 | Model, Server, Client and MCP; normal root versions | | WMTP | OPC 40505, 1.0.0 | Bundled in MachineTool; distinct CLR/wire namespace and independent WMTP-only hosting | | GMS | OPC 40210 reference 1.0.1, normative model 1.0.0 | Model, Server, Client and MCP; normal root versions | | CranesHoists | OPC 40020-1, 1.00 | Model, Server, Client and MCP; all four plus Debug variants forced preview | There are **12 new packable projects**. No separate WMTP package/profile/guide, root version bump, tag, release or package publication is included. Mandatory instance structure is the default; selected optional features require explicit providers. The implementation reuses Machinery results/jobs/files/ProcessValues and Robotics topology, including retained MachineTool Production, defined GMS jobs/parts, modern ISA95/Machinery jobs, shared-owner hosting and isolated instances alongside MachineVision. Runtime and integration fixes preserve raw quality/timestamps, coherent acquisition, namespace ownership, accepted-configuration state, borrowed-resource lifetime, session/node/file cleanup, terminal-value publication, event propagation and endpoint-aware capability publication. Firmware/licence transfer means provider acceptance, not installation/activation. Cancellation does not silently abort another caller's operation. The later upstream MCP expansion is integrated without losing either family set or its default-off privileged/live execution policy. ### Conformance and scope Canonical model inputs are pinned to UA-Nodeset revision `96a08945425d0295edb3607d2a38f6841ef44046`. **GMS upstream exception:** [Annex A.1](https://reference.opcfoundation.org/specs/OPC-40210/annex-a) makes the released NodeSet normative, but §12.3.2.7 requires undefined `GMS_ProductionStatisticsType`. Inherited statistics and defined jobs/parts are implemented without inventing a standard type/NodeId; the complete GMS Production facet is withheld. The requirement ledger records **102 positively evidenced CU rows, 96 directly negative-tested rows and six explicit negative-evidence limitations**. All 648 test-class/name/TRX links were independently resolved to passing cases. The six limitations concern Stacklight, retained legacy PowerOnDuration, Machinery PowerOnDuration, WorkingUnit, Obligation and MaintenanceMode. They are not claims that every invalid-input or hardware-control behavior was tested. The undefined GMS requirement is outside the 102 defined CUs. No external certification claim is made. Retained baseline complete-assembly line coverage, with generated code retained and no source exclusions: | Family | Model | Server | Client | | --- | ---: | ---: | ---: | | MachineTool/WMTP | 83.80% | 91.98% | 84.74% | | GMS | 95.51% | 90.63% | 88.38% | | CranesHoists | 92.76% | 94.45% | 92.24% | These nine measurements predate the later focused review fixes and merges; they are not relabelled as new `ecc4a7d6c` percentages. The current head's separate CI code-coverage check succeeded. No new exclusions or threshold relaxations were introduced. ## Related Issues - Fixes [#4764](https://github.com/OPCFoundation/UA-.NETStandard/issues/4764), the implementation/design and acceptance tracker. ## Checklist _Put an `x` in the boxes that apply. You can complete these step by step after opening the PR._ - [ ] I have signed the [CLA](https://opcfoundation.org/license/cla/ContributorLicenseAgreementv1.0.pdf) and read the [CONTRIBUTING](https://github.com/OPCFoundation/UA-.NETStandard/blob/master/CONTRIBUTING.md) doc. - [x] I have added tests that prove my fix is effective or that my feature works and increased code coverage. - [x] I have added all necessary documentation. - [ ] I have verified that my changes do not introduce (new) build or analyzer warnings. - [ ] I ran **all** tests locally using the **UA.slnx** solution against at least .net **framework** and .net **10**, and all passed. - [ ] I fixed **all** failing and flaky tests in the CI pipelines and **all** CodeQL warnings. - [x] I have addressed **all** PR feedback received.
16 KiB
What's New in OPC UA .NET Standard 2.0
Version 2.0 expands the SDK beyond the 1.5.378 client/server APIs with managed connections, model-driven application development, injectable services, and distributed deployment options. This overview highlights what those changes enable; the linked guides contain API contracts, examples, and limitations.
Contents
- At a glance
- Feature details
- Dependency injection and hosting
- Client
- Source generators and modeling
- Type system and immutability
- Performance, memory, and pooling
- Async, cancellation, and
TimeProvider - Native AOT
- OPC UA companion-spec coverage
- Security and certificates
- Global Discovery Server
- Part 14 PubSub modernization
- High availability and redundancy
- Tooling and diagnostics
- Further reading
At a glance
| Area | What 2.0 enables |
|---|---|
| Application development | Host clients and servers through one dependency-injection builder; generate model types and typed client proxies instead of writing service plumbing. |
| Client connections | Use ManagedSession for reconnection and failover, with callback-based or asynchronous streaming subscriptions. |
| Data and deployment | Use strongly typed values, arrays, and matrices; publish supported applications with Native AOT. |
| Server capabilities | Add historian providers, alarms, state machines, file access, and the models in the specification catalogue through reusable services. |
| Security and discovery | Manage certificate lifecycles and identities through providers, and integrate GDS pull/push management and token services. |
| PubSub and availability | Compose publishers/subscribers with transport packages, or opt into redundancy and distributed state for client/server deployments. |
Feature details
Dependency injection and hosting
services.AddOpcUa() provides a common entry point for clients, servers, and
feature libraries. The .NET Generic Host manages server lifetime; options,
telemetry, identities, certificates, and application providers use the same
container. Direct construction remains available.
See Dependency Injection.
Client
ManagedSession manages connection recovery behind a fluent builder while the
classic Session remains available for applications that own that lifecycle.
The V2 subscription API adds options-based callbacks, triggering relationships,
automatic partitioning, and IAsyncEnumerable streams for short-lived monitoring.
Typed helpers cover history, alarms, files, and model-change tracking.
Opt-in session-less invocation supports the service
sets permitted by OPC 10000-4 without creating a Session; subscriptions still
require one. HTTPS and WebSocket OpenAPI mappings also support
web-facing integration.
Generation-bound session clients capture a transport/session
generation and namespace mappings. An invalidated binding fails instead of
silently retargeting requests after a reconnect.
See Sessions, Subscriptions,
File System Client, and Model Change Tracking.
Source generators and modeling
ModelDesign and NodeSet2 inputs generate node-manager scaffolding, state types,
and typed ObjectType client proxies. POCO annotations generate IEncodeable
implementations, and model dependencies can be registered across assemblies.
Models that change independently of the binary can instead be loaded at runtime.
Fluent complete Method results
carry operation diagnostics, ordered input-argument results and output values.
Forwarded diagnostics are resolved into the receiving response's string table,
subject to diagnostic requests and authorization.
See Node Managers, Source-Generated Data Types,
Model Dependencies, and Runtime NodeSets.
Type system and immutability
Readonly value types and the Variant-based API reduce boxing and make OPC UA
values explicit. ByteString, ArrayOf<T>, and MatrixOf<T> represent binary,
array, and matrix data. Runtime complex-type loading supports server-defined
structures and enumerations without requiring a generated CLR class for each type.
See Complex Types and Schema Generation.
Performance, memory, and pooling
Value-type representations and pooled buffers reduce allocations in encoding and notification paths. Server work also improves resource lifetime and repeated permission checks. These changes do not imply that every workload is faster; use the measured results and sizing guidance for your deployment. See Benchmarks, Server Scalability, and Rate Limiting.
Async, cancellation, and TimeProvider
AsyncCustomNodeManager supports asynchronous service and data-source operations.
Request cancellation follows the request lifetime, while TimeProvider enables
controlled clocks and timers for testing. Existing synchronous compatibility APIs
do not make blocking waits appropriate in new asynchronous handlers.
Dynamic node removal can await
final-value publication
through the existing subscription engine. The boundary is inclusion in the
server's Publish response, not a client transport acknowledgment.
See Async Server Support and Node Managers.
Native AOT
Source-generated models, runtime type representations, and revised serialization paths support applications published without a JIT compiler. Choose AOT-compatible providers and the default complex-type builder; the optional Reflection.Emit builder still requires runtime code generation. See Native AOT: publish an application and Complex Types.
OPC UA companion-spec coverage
The SDK adds model libraries, hosting support, and client helpers for the following services and domains. Core OPC UA specification parts are listed separately from domain-specific companions and draft extensions.
Core specification services and models
| Capability | Specification | Guide |
|---|---|---|
| Alarms and conditions | OPC 10000-9 | Alarms and Conditions |
| Historical access and aggregates | OPC 10000-11 and OPC 10000-13 | Historical Access and Aggregates |
| State machines | OPC 10000-16 | State Machines |
| Alias names | OPC 10000-17 | Alias Names |
| Node and reference management | OPC 10000-4 | Node Management |
| File transfer and file systems | OPC 10000-5 Annex C and OPC 10000-20 | File System Client |
| Roles and user management | OPC 10000-18 | Role-Based User Management |
| Global discovery and certificate management (GDS) | OPC 10000-12 | Global Discovery Server |
| Local discovery (LDS and LDS-ME) | OPC 10000-12 | LDS / LDS-ME and the Console LDS Server sample |
| Device onboarding: registrar ticket administration | OPC 10000-21 | OnboardingClient and the onboarding sample |
Companion and extension models
| Domain | Specification or status | Guide |
|---|---|---|
| Device composition and software updates | OPC 10000-100 (Devices) | Device Integration and Software Update |
| Asset discovery, health, maintenance, documentation and location | OPC 10000-110 (Asset Management Basics) | Asset Management Basics |
| Machines, job management, process values, energy and result transfer | OPC 40001-1/-2/-3/-4/-101 (Machinery), with OPC 34100 (Energy Consumption Management) and OPC 30081 (PA-DIM) | Machinery |
| Machine monitoring, tools, production and wireless peripherals | OPC 40501-1 (MachineTool) and OPC 40505 (WMTP); both models share the MachineTool packages | MachineTool and WMTP |
| Geometric measurement systems, qualification and results | OPC 40210 (GMS); the undefined upstream production-statistics CU prevents claiming the complete Production facet | GMS |
| Crane systems, loads, protection observations and limit requests | OPC 40020-1 (Cranes and Hoists); preview packages, with equipment behavior supplied by providers | Cranes and Hoists |
| Pumps, compressors and vacuum pumps | OPC 40223 (Pumps and Vacuum Pumps) | Pumps |
| Scales and scale systems | OPC 40200 (Weighing Technology), with OPC 30050 (PackML) | Scales |
| Motion-device systems and controllers | OPC 40010-1 (Robotics), over OPC 10000-200 (Industrial Automation, its own Opc.Ua.IA package) |
Robotics |
| Task-level robot commands | Robot Intent (draft) | Robot Intent |
| Manufacturing resources and job control | OPC 10030 (ISA-95 Common Model) and OPC 10031-4 (Job Control V1/V2) | ISA-95 |
| Relative and geographic positioning | OPC 10000-210 (RSL) and OPC 10000-211 (GPOS) | Positioning |
| Machine Vision control, recipes, configuration, results and assets | Released OPC 40100-1 and OPC 40100-2 | Machine Vision |
| Perception, media, inference and feedback | Vision Perception (draft); distinct from the released Machine Vision models | Perception |
| Model catalogues, deployments, and inference | AI Model Management and Inference (draft) | AI Model Management |
| Resource registration, versioning, and federation | xRegistry abstract base model (draft) | xRegistry |
| Scene bindings and address-space materialization | OpenUSD Bindings and OpenUSD Scene (both draft) | OpenUSD |
| Web of Things connectivity and conversion | OPC 10100-1, with preview registry extensions | WoT Connectivity, WoT / NodeSet Conversion, and WoT Bindings |
The draft Generators model in the generator server is a sample-local model, not a standalone SDK library.
Draft entries are identified by model name rather than an unverified specification number; their namespace URIs and NodeIds remain provisional. The guides describe provider requirements and supported operations. Model coverage does not imply complete runtime implementation or certification for every specification. Package channel and model maturity are independent: a released specification can ship in a preview-only package. The release policy defines the package families that remain preview-only.
Security and certificates
Reference-counted certificates and CertificateManager provide explicit ownership,
trust-list management, rotation, and lifecycle notifications. Identity providers
support application-specific authentication. Pluggable crypto providers let an
application replace platform cryptography with another library, a remote service,
or hardware such as a TPM, HSM, or PKCS#11 token. Providers can be selected by
purpose and security policy, including support for hardware-held private keys.
ECC SecureChannel and user-token policies, including the AEAD variants, are available
on every target; on .NET Framework the ECDH agreement and the AES-GCM and
ChaCha20-Poly1305 ciphers use BouncyCastle. Curve and cipher availability also depends
on the platform.
See Certificate Manager, Identity Providers,
Crypto Providers, and ECC Profiles.
Global Discovery Server
GDS support extends application registration, pull/push certificate management,
custom certificate groups, token issuance, and credential services. A Local
Discovery Server is also available as a hosted component or standalone sample.
For OPC 10000-21 device onboarding, clients register and unregister tickets with
a device registrar through OnboardingClient, and the registrar keeps them in a
pluggable ITicketStore.
See GDS for capability boundaries and conformance evidence,
Authorization Service, and Key Credential Service.
Part 14 PubSub modernization
A fluent builder and dependency-injection extensions compose PubSub applications from separate runtime, transport, and server-integration packages. UADP and JSON encoding, discovery, retained metadata, runtime configuration, diagnostics, and Security Key Service integration support publisher/subscriber workflows. UDP/DTLS, Ethernet, MQTT and Kafka transports use their corresponding packages; the Kafka package supplies the Part 14 broker mapping rather than requiring an application-specific transport implementation. Transport and cryptographic capabilities remain platform-dependent; in particular, the DTLS Curve25519 / Curve448 profiles are not registered. See PubSub for supported profiles, transports, and examples.
High availability and redundancy
Server redundancy metadata and ManagedSession failover support OPC UA redundancy
workflows. Optional distributed stores add address-space, session, and subscription
mirroring with eventual or strong consistency choices. Kubernetes integration
provides deployment, discovery, and readiness support.
See High Availability, Replica-Consistent NodeIds,
and Kubernetes for configuration and deployment constraints.
Tooling and diagnostics
The MCP server exposes client operations and packet-capture tools to agents.
Bounded companion profiles include MachineTool with WMTP, GMS, CranesHoists,
Vision, Robotics, AMB, Machinery, Scales, Pumps, Device Integration, ISA-95 and
Positioning. They compose over named sessions without duplicating connection
tools. Dedicated profiles also cover WoT/xRegistry documents, GDS,
reference-only credentials, roles/users, files, alarms, history and schemas.
Live WoT and PubSub workflows require explicit host capabilities and operation
or network grants; selecting a catalogue is not permission to execute it.
The adapters reuse the stack's typed client workflows.
ITelemetryContext supplies application logging, metrics, and tracing, with
audit and redaction support. A migration analyzer and code fixer assist with
mechanical API updates.
See MCP Server and Diagnostics.
Further reading
- Migration Guide — breaking changes, per-API replacements, and the migration analyzer workflow for upgrading from 1.5.378.
- Documentation index — task-based routes into the SDK guides.
- Sample applications — runnable client, server, PubSub, and companion-model examples.
- Profiles and facets — capability and platform overview.