Files
5899354441 Clarify documentation, migration guidance, and SDK selection (#4823)
# Description

Remove stock phrasing and correct misleading or inconsistent technical
documentation. The initial two passes covered 367 Markdown files,
followed by an interactive review of 169 editorial flags. The U5
interpretation originally deferred in that review has since received the
upstream Mantis answer recorded by #4843; remaining server/spec
follow-ups stay explicit in the CTT log.

- Correct package responsibilities, migration steps, API names,
ownership, protocol descriptions and links. Keep bundled migration
guides synchronized. Preserve historical conclusions as historical
records with separate re-check notes.
- Provide at least two rendered TOC levels throughout `docs/`. Convert
appropriate architecture figures to Mermaid without changing code
examples, transcripts or historical quotations.
- Address the October 19 feedback with concrete setup/migration
instructions, corrected certificate paths and PubSub names, shorter
repeated caveats, consistent XML comments, and a full review of the
Concepts guide. Retain #4839's API corrections.
- Integrate #4841's runtime/performance guidance and review
incoming/recent prose. Preserve dated measurements rather than claiming
new benchmark runs; clarify allocation ratios, startup-only processor
settings, JIT warm-up and the benchmark commit's scope. Missing raw
measurement artifacts and repeat ranges remain tracked by #4842.
- Merge master through `e8c5d800a` in `32c6394b7`. Resolve the CTT log
conflict using the updated Mantis states and OPC answers, retaining
historical framing and re-checks for C28/C32/C43.
- Address the latest naming/index feedback in `adb5bf693`: rename the
guides to `docs/WotCon.md` and `docs/WotNodeSetConversion.md`; move the
provider and DataType-declaration contracts into the conversion guide
and remove `docs/WoT.md`. Rename `samples/DI` to `samples/Di` and
`samples/Isa95` to `samples/ISA95`. Add content-index READMEs to Di,
FluentApi, ISA95, Lds and PubSub; update solution entries, project
references, Docker/CI paths, test fixture paths and documentation links
with exact casing.

**WoT guide scope.** This branch retains the detailed conversion guide
that #4758 had replaced with an anchor stub. Conversion limits, verified
document sets, preservation rules and provider ownership now live
together in `WotNodeSetConversion.md`; binding/runtime guidance remains
in `WotBindings.md` and `WotCon.md`. The design-rationale/test-ledger
prose was shortened, the oversized argument-table cell moved into its
section, and existing anchors preserved.

**SDK policy is a separate, explicit user-directed change.**
`global.json` sets a stable minimum of `10.0.400`, `rollForward:
latestMajor`, and `allowPrerelease: false`. Newer major SDKs are
permitted; CI's explicit SDK pins are unchanged. README, GettingStarted,
DeveloperGuide and Recycling instructions reflect the possible analyzer
differences. The image-contract regression fix accepts compatible stable
SDK images instead of requiring exact equality with the floor.

The latest four rename/index threads are resolved after publication.
Three older threads remain open: universal obsolete-removal timing,
unconditional nonce-strength wording, and a blanket Vision NativeAOT
claim. Existing implementation/evidence constraints are explained in
their inline replies. The two-level TOCs remain as requested.

## Validation

- `git diff --check` and staged diff checks: passed. The untouched
upstream AutoID NodeSet retains its provenance bytes, including two
existing license-header trailing spaces.
- `.\.azurepipelines\validate-migration-plugin.ps1`: passed; 15 bundled
migration documents and manifests synchronized.
- Documentation/path validation: **101** documents retain two rendered
TOC levels (**2,228** entries), with idempotent formatting. **52** new
relative links and their anchors passed exact-case checks. No tracked
references to the old guide/sample paths remain. Both relocated
provider-contract sections are preserved in the destination.
- `dotnet sln UA.slnx list`: passed; shows the renamed Di/ISA95 projects
and the existing FluentApi/Lds/PubSub projects. Updated solution and
pump ProjectReference paths also passed exact-case existence checks.
- Latest focused commands, run from the repository root:

```powershell
# Passed: 61 channel send-order and reconnect tests.
dotnet test tests\Opc.Ua.Core.Tests\Opc.Ua.Core.Tests.csproj -p:CustomTestTarget=net10.0 --filter 'FullyQualifiedName~UaSCBinaryChannelSendOrderTests|FullyQualifiedName~TcpReconnectKeyAgreementTests' --verbosity minimal

# Passed: 5 pump datasheet tests; builds the renamed pump sample.
dotnet test tests\Opc.Ua.Di.Tests\Opc.Ua.Di.Tests.csproj -p:CustomTestTarget=net10.0 --filter 'FullyQualifiedName~PumpDatasheetConformanceTests' --verbosity minimal

# Passed: 4 repository NodeSet path/round-trip tests, including the moved pump models.
dotnet test tests\Opc.Ua.Types.Tests\Opc.Ua.Types.Tests.csproj -p:CustomTestTarget=net10.0 --filter 'FullyQualifiedName~RepositorySourceSurvivesSerializedLinkedPartitionsAsync' --verbosity minimal

# Passed: build, zero warnings/errors.
dotnet build samples\ISA95\MinimalIsa95Server\MinimalIsa95Server.csproj -p:CustomTestTarget=net10.0 -f net10.0 --verbosity minimal

# Passed: dependent sample-test project build, zero warnings/errors.
dotnet build tests\Opc.Ua.WotCon.Samples.Tests\Opc.Ua.WotCon.Samples.Tests.csproj -p:CustomTestTarget=net10.0 -f net10.0 --verbosity minimal
```

Earlier focused integration checks passed 2,620 tests across AutoID,
event queues/scheduling, source generation, MCP/package profiles and
WoT. Both reviewed Mermaid diagrams rendered locally without network
access. These checks are not a full solution run.

The full solution has **not** been rerun for this review. Earlier
`dotnet test UA.slnx -p:CustomTestTarget=net10.0 --verbosity quiet` did
not pass: three AOT projects rejected VSTest and 20 Vision tests failed
during graphics initialization with `OutOfMemoryException`. Remaining
long-running tests were stopped at the user's request. A focused Vision
rerun passed 558 tests and reproduced those 20 failures. The earlier
`dotnet test UA.slnx -p:CustomTestTarget=net48 --verbosity quiet` was
blocked by the former SDK pin and was not retried after the policy
change. The user approved proceeding with those limitations documented;
current remote CI is not claimed green.

## Related Issues

- Follow-up #4842 tracks the requested 2.0.2+ benchmark/tuning and
diagnostic-tool documentation refresh. #4841 supplies documentation and
earlier results, not all newly requested measurements.
- #4758 explains the conversion guide's earlier consolidation; the
current provider contracts are now consolidated into
`WotNodeSetConversion.md`.
- #4839 supplies the reviewed API corrections; #4843 supplies the
updated CTT issue record.
- The original prose cleanup and SDK policy were user-requested without
a source issue. No new runtime architecture is introduced by these
documentation edits.

## 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.
- [ ] 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.
- [ ] I have addressed **all** PR feedback received.

---------

Co-authored-by: Roman Ettlinger <romanett98@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 10:10:55 +02:00

10 KiB

PubSub (Part 14)

When to read this: Read this if your application uses any of the Opc.Ua.PubSub.* namespaces, the legacy UaPubSubApplication factory, the JsonEncodingMode enum, or RawData field encoding. This sub-doc documents the PubSub breaking and behaviour-affecting changes in 2.0.

For the full Part 14 feature reference, including additive 2.0 capabilities, see PubSub.md. This sub-doc focuses on migration work required for existing consumers.

Contents

1. PubSub assemblies and NuGet packages renamed and split

The monolithic 1.5.378 PubSub library has been refactored into one core assembly plus dedicated transport and server-integration assemblies. Each assembly ships as its own NuGet package under the OPCFoundation.NetStandard.Opc.Ua.PubSub* package prefix:

Assembly NuGet package Contents
Opc.Ua.PubSub OPCFoundation.NetStandard.Opc.Ua.PubSub Core application, encoding, scheduling, security, and DataSets.
Opc.Ua.PubSub.Udp OPCFoundation.NetStandard.Opc.Ua.PubSub.Udp UDP datagram transport (Part 14 §7.3.2).
Opc.Ua.PubSub.Eth OPCFoundation.NetStandard.Opc.Ua.PubSub.Eth Ethernet Layer 2 transport (opc.eth://, EtherType 0xB62C).
Opc.Ua.PubSub.Mqtt OPCFoundation.NetStandard.Opc.Ua.PubSub.Mqtt MQTT broker transport (Part 14 §7.3.4).
Opc.Ua.PubSub.Server OPCFoundation.NetStandard.Opc.Ua.PubSub.Server Server-side address-space integration (Part 14 §9).
Opc.Ua.PubSub.Adapter OPCFoundation.NetStandard.Opc.Ua.PubSub.Adapter External-server publisher/subscriber/Action binding over ManagedSession.

Consumers that previously referenced the single Opc.Ua.PubSub package must add the transport package(s) they use (...PubSub.Udp and/or ...PubSub.Mqtt) and, for address-space integration, the ...PubSub.Server package. Add ...PubSub.Adapter when a PubSub application must bind DataSets or Actions to an external OPC UA server through a managed client session. The root namespaces follow the assembly names (Opc.Ua.PubSub, Opc.Ua.PubSub.Udp, Opc.Ua.PubSub.Mqtt, Opc.Ua.PubSub.Server).

The legacy 1.04 top-level types listed in §2 are removed in 2.0. The sole bridge retained in the main PubSub assembly is the obsolete IUaPubSubDataStore interface. Existing application, connection, publisher, and configurator code must migrate to the modern fluent builder / DI surface.

2. UaPubSubApplication.Create* and the legacy 1.04 API are replaced

UaPubSubApplication.Create(...) (and its overloads) and the legacy 1.04 application, connection, publisher, and configurator types are removed in 2.0. There is no Opc.Ua.PubSub.Legacy compatibility package. Migrate those sites to the fluent builder or the DI extensions:

Removed legacy type New replacement
UaPubSubApplication IPubSubApplication (built via PubSubApplicationBuilder)
IUaPubSubConnection IPubSubConnection
UaPubSubConnection PubSubConnection (sealed runtime implementation, normally created by the builder)
IUaPublisher / UaPublisher IPubSubScheduler + WriterGroup (engine-driven)
UaPubSubConfigurator PubSubApplicationBuilder (fluent) + IPubSubConfigurationStore
PubSubJsonEncoder / PubSubJsonDecoder Opc.Ua.PubSub.Encoding.Json.JsonEncoder / JsonDecoder (System.Text.Json)

IUaPubSubDataStore remains in Opc.Ua.PubSub (marked [Obsolete], UA0023) because the modern bridge still consumes it; migrate to IPublishedDataSetSource (per-DataSet provider model) when convenient.

Codemod recipe:

// Before (1.5.378)
var app = UaPubSubApplication.Create("publisher.xml");
app.Start();
// ...
app.Stop();

// After (2.0)
ITelemetryContext telemetry = DefaultTelemetry.Create(
    logging => logging.AddConsole());
var builder = new PubSubApplicationBuilder(telemetry)
    .UseConfigurationFile("publisher.xml");
await using IPubSubApplication app = await builder.BuildAndStartAsync();
// ...
await app.StopAsync();

See PubSub.md §Fluent builder for the in-code form. Cites Part 14 §6.2.

3. JSON encoder switched to System.Text.Json

The Newtonsoft-based encoder (Opc.Ua.PubSub.Encoding.JsonNetworkMessage v1) is replaced with a System.Text.Json-backed encoder under src/Opc.Ua.PubSub/Encoding/Json/. Behaviour changes that may surface in callers:

  • The Newtonsoft.Json dependency is dropped. Core does not supply it either; add an explicit reference if application code still uses Newtonsoft APIs. See package dependency migration.
  • Numeric round-trips honour the .NET native precision instead of the Newtonsoft default (e.g. double → 17 significant digits, not 15).
  • The new encoder uses Utf8JsonWriter.
  • The decoder uses Utf8JsonReader and validates structurally; it rejects trailing junk where the old decoder silently truncated.

4. JsonEncodingMode Reversible/Non-Reversible encodings removed

Opc.Ua.PubSub.Encoding.Json.JsonEncodingMode.Reversible and Opc.Ua.PubSub.Encoding.Json.JsonEncodingMode.NonReversible are removed in favour of the Part 6 §5.4.1 / Part 14 §7.2.5 names:

Old New
JsonEncodingMode.Reversible JsonEncodingMode.Verbose
JsonEncodingMode.NonReversible JsonEncodingMode.Compact
(new) JsonEncodingMode.RawData

Verbose carries the same information as the old Reversible mode, and Compact the same as NonReversible; the rename is a public-API change. Note the encoder switch to System.Text.Json (§3) can change incidental formatting (e.g. number precision), so output is not guaranteed byte-identical to the 1.04 Newtonsoft encoder. No [Obsolete] aliases exist — consumers update enum references at upgrade time. Background: #3609.

5. UADP RawData bounded-field wire-compatibility break

This is an on-wire compatibility break for consumers of bounded RawData fields. Per Part 14 §7.2.4.5.11, String, ByteString, XmlElement, and array fields encoded via DataSetFieldContentMask.RawData are now padded to the maximum size declared in FieldMetaData.MaxStringLength or FieldMetaData.ArrayDimensions. The on-wire length prefix is suppressed for padded fields; consumers receive the exact MaxStringLength bytes with trailing NULs as the spec mandates, and decoders trim the trailing NUL fill on read.

If your configuration uses RawData but does not declare MaxStringLength or ArrayDimensions, the encoder falls back to the legacy length-prefixed form (variable size) and the configuration validator surfaces issue code PSC0025 (SpecClause = "7.2.4.5.11") so the missing bound is reported at configuration time. Closes #3566.

6. Compatibility matrix

Surface 2.0 outcome
UaPubSubApplication.Create(string) from XML config Source break. Replace with PubSubApplicationBuilder.UseConfigurationFile(...) and BuildAndStartAsync().
UaPubSubApplication.Start() / .Stop() Source break. Use IPubSubApplication async lifecycle methods.
Direct construction of UaPubSubConnection etc. Source break. Configure connections through the fluent builder / DI surface.
IUaPubSubDataStore Compiles with [Obsolete]; PubSubApplicationBuilder.WithDataStore(...) adapts it temporarily. Migrate to IPublishedDataSetSource.
Newtonsoft-based PubSub JSON formatting assumptions Behavioural break. System.Text.Json precision and validation rules apply.
JsonEncodingMode.Reversible / NonReversible Source break. Rename to Verbose / Compact.
DataSetFieldContentMask.RawData with bounded strings/arrays Wire break. Fields are padded and length prefixes suppressed per spec.

See also