Skip to content

fix(build): restore multi-TFM compatibility for Release pack#194

Draft
ottobolyos wants to merge 18 commits into
TrakHound:masterfrom
ottobolyos:fix/multi-tfm-compat
Draft

fix(build): restore multi-TFM compatibility for Release pack#194
ottobolyos wants to merge 18 commits into
TrakHound:masterfrom
ottobolyos:fix/multi-tfm-compat

Conversation

@ottobolyos

@ottobolyos ottobolyos commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Commit dd2eb424 chore(warnings): annotate Windows-only service + socket APIs with SupportedOSPlatform (2026-05-22) landed [SupportedOSPlatform("windows")] decorations on six Service / HTTP-server types/methods to silence CA1416 on net8.0. The decoration's type lives in System.Runtime.Versioning on .NET 5.0+ but is absent / inaccessible on net4x and netstandard2.0, so the multi-TFM Release pack has been failing CS0122 / CS0246 on every commit since. CI runs only Debug / net8.0 and never exercises the Release multi-TFM matrix, which is how the regression slipped through.

This PR restores Release pack-ability across the full TFM matrix by wrapping each affected site in #if NET5_0_OR_GREATER. The matrix-spanning CI gate that prevents the next slip ships in the follow-up PR (warnings cleanup + Release-pack gate) — see § Follow-up below.

Behaviour change

None at runtime. The [SupportedOSPlatform("windows")] decoration remains in effect under .NET 5.0+; the only difference is that net4x and netstandard2.0 no longer try to reference a type that doesn't ship there.

Bug classes covered

Class Diagnostic Site count Root-cause fix
Multi-TFM attribute compat CS0122 / CS0246 — SupportedOSPlatformAttribute absent on net4x / netstandard2.0 6 files Wrap using System.Runtime.Versioning; + attribute usages in #if NET5_0_OR_GREATER.
LangVersion fallback on netstandard2.0 CS8370 — using declarations require C# 8.0 1 csproj (MTConnect.NET-XML) Add <LangVersion>8.0</LangVersion> to the project's <PropertyGroup>.

Tests

  • tests/MTConnect.NET-Common-Tests/Platform/SupportedOSPlatformAttributePresenceTests.cs — for each of the six wrapped Service / HTTP-server members, reflection asserts the [SupportedOSPlatform("windows")] attribute is present with PlatformName == "windows" when running under net8.0. Pins the API surface so a future "someone removes the attribute" regression is caught.
  • tests/MTConnect.NET-XML-Tests/Xml/UsingDeclarationsTests.cs — exercises the C# 8.0 using declaration code path in MTConnect.NET-XML via XsdPreprocessor.StripXsd11Constructs. Pins the path against regression.
  • tests/MTConnect.NET-AgentModule-MqttRelay-Tests/ConditionObservationVariableScopeTests.cs — scans Module.cs for the shadowing foreach (var observation in ...) declaration that triggered CS0136 under net4x. Pins the master-side rename against future re-introduction of the observation shadow. Master already applies the rename (as conditionObservation) via the v7.0-prerelease landings on 2026-06-25/26, so the fixture asserts the invariant against the existing implementation.

Files touched

  • libraries/MTConnect.NET-HTTP/Ceen/Httpd/HttpServer.cs
  • libraries/MTConnect.NET-Services/{WindowsService,MTConnectAgentService,MTConnectAdapterService}.cs
  • agent/MTConnect.NET-Applications-Agents/Service.cs
  • adapter/MTConnect.NET-Applications-Adapter/Service.cs
  • libraries/MTConnect.NET-XML/MTConnect.NET-XML.csproj
  • Test files listed above.

Follow-up

PR #195 (warnings cleanup) ships:

  • Root-cause fixes for CS0162 (4 sites), SYSLIB0057 (5 sites), CS0809 (HTTP), CA2022 (HTTP), CS1574 (2 App projects), NU5017 (SysML) — every diagnostic that the Release pack also surfaces on master today.
  • A new CI job release-pack running dotnet pack -c Release across the full TFM matrix as the regression-prevention gate. Without that gate the same class of slip recurs.
  • Tests per fix where the diagnostic has a meaningful runtime semantic.

@ottobolyos

Copy link
Copy Markdown
Contributor Author

Follow-up PR for the remaining Release-pack diagnostic classes is now open as draft: #195 — six bug classes (CS0162, SYSLIB0057, CS0809, CA2022, CS1574, NU5017) cleaned at root cause, plus a new release-pack CI job that runs dotnet pack -c Release across the full multi-TFM matrix on every push and every non-draft PR to prevent the regression class recurring.

MTConnectHttpServer.cs moved in the v7.0-prerelease landings on
2026-06-26 (Patrick's direct pushes after PR TrakHound#201 merged). Every
route handler's line-number reference in docs/reference/http-api.md
shifted by 4-22 lines. The committed page still pointed at pre-move
lines, so `docs/scripts/generate-reference.sh --check` failed on
every CI run since 2026-06-26 - blocking the whole Docs-site +
build-and-test + route-check-e2e job DAG downstream.

Regenerated http-api.md against current source. Line-number metadata
only; no content changes.
ottobolyos added a commit to ottobolyos/mtconnect.net that referenced this pull request Jul 15, 2026
Adds a reflection-based fixture under
tests/MTConnect.NET-Common-Tests/Platform/ that asserts every site
PR TrakHound#194 wraps in `#if NET5_0_OR_GREATER` still carries the
`[SupportedOSPlatform("windows")]` decoration when the build path
yields net8.0. The fixture covers the six sites from the May-22
warnings sweep — WindowsService, MTConnectAgentService,
MTConnectAdapterService, both `MTConnect.Applications.Service`
types (agent + adapter), and the
`Ceen.Httpd.HttpServer.AppDomainBridge.HandleRequest(SocketInformation,...)`
plus `HttpServer.RunClient(SocketInformation,...)` HTTP-server
sites — and pins the API surface so a future contributor who
removes the attribute or narrows the wrap fails the test.

The fixture runs only under net8.0 (the only TFM every test project
targets), so cannot directly fail under the pre-fix code. Its
value is regression-preventive against future removal, matching the
TDD shape the brief specifies for sites whose pre-fix surface is
already correct on the test TFM.

Extends the test csproj with reflection-only references to
MTConnect.NET-Services, MTConnect.NET-HTTP,
MTConnect.NET-Applications-Agents, and
MTConnect.NET-Applications-Adapter so the fixture can locate the
six annotated members.
ottobolyos added a commit to ottobolyos/mtconnect.net that referenced this pull request Jul 15, 2026
Adds a fixture under tests/MTConnect.NET-XML-Tests/Xml/ that
exercises XsdPreprocessor.StripXsd11Constructs — the production site
that uses the C# 8.0 `using var reader = ...;` declaration. On
netstandard2.0 the compiler's default LangVersion is 7.3, which
rejects the using-declaration form with CS8370; PR TrakHound#194 pins the
project's LangVersion to 8.0. The fixture runs only under net8.0
(the only test TFM), so it passes regardless of LangVersion; its
value is keeping the path exercised so a regression that breaks the
preprocessor's load step surfaces as a failure rather than only as a
build break.
ottobolyos added a commit to ottobolyos/mtconnect.net that referenced this pull request Jul 15, 2026
Adds a structural test under
tests/MTConnect.NET-AgentModule-MqttRelay-Tests/ that scans
Module.cs for the shadowing `foreach (var observation in ...)`
declaration inside AgentObservationAdded. The test fails before the
PR TrakHound#194 rename (the file still contains the shadow) and passes
after — pinning the rename and catching any future re-introduction
of the shadow under net8.0, which is the only TFM the CI matrix
exercises directly.

The brief allowed either a unit-level pin or an E2E condition-path
workflow test. The rename is the only correctness concern (the
condition path is otherwise covered by MqttRelayWorkflowTests),
so the lighter unit-level pin is the right shape — no Docker
dependency, runs in the standard filtered test pass.
@ottobolyos ottobolyos force-pushed the fix/multi-tfm-compat branch from 85cd487 to ecd5542 Compare July 15, 2026 08:15
…rrors

The `Prepare generated docs` job runs `generate-api-ref.sh` after the
drift gate; that script builds `build/MTConnect.NET-SysML-Import`
which transitively references Scriban 7.2.0. NuGet detects three
known vulnerabilities in that version:

- GHSA-6q7j-xr26-3h2c (moderate, NU1902)
- GHSA-7jvp-hj45-2f2m (high, NU1903)
- GHSA-q6rr-fm2g-g5x8 (moderate, NU1902)

`<TreatWarningsAsErrors>` promotes them to errors, so the job fails
on `build/MTConnect.NET-SysML-Import.csproj`. Bumping to 7.2.2 (per
dependabot PR TrakHound#204) resolves all three advisories with no source
changes required.

Piggybacked into this drift-regen PR because the two failures share
the same failing job (`Prepare generated docs`) and land as the same
gate red across every push and every PR against master. Landing them
together turns the whole DAG green in a single merge; landing them
separately leaves the gate red across the intermediate state.

Supersedes dependabot TrakHound#204.
ottobolyos added a commit to ottobolyos/mtconnect.net that referenced this pull request Jul 15, 2026
Adds a reflection-based fixture under
tests/MTConnect.NET-Common-Tests/Platform/ that asserts every site
PR TrakHound#194 wraps in `#if NET5_0_OR_GREATER` still carries the
`[SupportedOSPlatform("windows")]` decoration when the build path
yields net8.0. The fixture covers the six sites from the May-22
warnings sweep — WindowsService, MTConnectAgentService,
MTConnectAdapterService, both `MTConnect.Applications.Service`
types (agent + adapter), and the
`Ceen.Httpd.HttpServer.AppDomainBridge.HandleRequest(SocketInformation,...)`
plus `HttpServer.RunClient(SocketInformation,...)` HTTP-server
sites — and pins the API surface so a future contributor who
removes the attribute or narrows the wrap fails the test.

The fixture runs only under net8.0 (the only TFM every test project
targets), so cannot directly fail under the pre-fix code. Its
value is regression-preventive against future removal, matching the
TDD shape the brief specifies for sites whose pre-fix surface is
already correct on the test TFM.

Extends the test csproj with reflection-only references to
MTConnect.NET-Services, MTConnect.NET-HTTP,
MTConnect.NET-Applications-Agents, and
MTConnect.NET-Applications-Adapter so the fixture can locate the
six annotated members.
ottobolyos added a commit to ottobolyos/mtconnect.net that referenced this pull request Jul 15, 2026
Adds a fixture under tests/MTConnect.NET-XML-Tests/Xml/ that
exercises XsdPreprocessor.StripXsd11Constructs — the production site
that uses the C# 8.0 `using var reader = ...;` declaration. On
netstandard2.0 the compiler's default LangVersion is 7.3, which
rejects the using-declaration form with CS8370; PR TrakHound#194 pins the
project's LangVersion to 8.0. The fixture runs only under net8.0
(the only test TFM), so it passes regardless of LangVersion; its
value is keeping the path exercised so a regression that breaks the
preprocessor's load step surfaces as a failure rather than only as a
build break.
ottobolyos added a commit to ottobolyos/mtconnect.net that referenced this pull request Jul 15, 2026
Adds a structural test under
tests/MTConnect.NET-AgentModule-MqttRelay-Tests/ that scans
Module.cs for the shadowing `foreach (var observation in ...)`
declaration inside AgentObservationAdded. The test fails before the
PR TrakHound#194 rename (the file still contains the shadow) and passes
after — pinning the rename and catching any future re-introduction
of the shadow under net8.0, which is the only TFM the CI matrix
exercises directly.

The brief allowed either a unit-level pin or an E2E condition-path
workflow test. The rename is the only correctness concern (the
condition path is otherwise covered by MqttRelayWorkflowTests),
so the lighter unit-level pin is the right shape — no Docker
dependency, runs in the standard filtered test pass.
ottobolyos and others added 9 commits July 15, 2026 12:57
… decision

Commit c2041ce ("Updated Docs Site", 2026-06-26) reverted the nav
logo to a plain-text title on the grounds that "logo might be too
small to read". The `themeConfig.logo` and `themeConfig.siteTitle:
false` lines in `docs/.vitepress/config.ts` were commented out; VitePress
now renders "MTConnect.NET" as text in `.VPNavBarTitle` rather than
an <img> under the previous logo-in-nav layout.

The Landing_Page_Carries_The_House_Style_Surfaces fixture has been
red on every push to master since 2026-06-26 because it asserted the
old logo-in-nav layout that the maintainer removed. Adapting the
fixture to the current maintainer intent: assert the nav-bar title
text is "MTConnect.NET" instead of the img.logo `src`. The hero image
assertion (line 349-352) continues to pin the wordmark rendering in
the landing hero block, which the maintainer explicitly retained
(same commit: "Updated hero logo to use a larger image").
Commit c2041ce ("Updated Docs Site" 2026-06-26) swapped the hero
image from `/logo.png` (32-px favicon) to `/logo-large.png` (larger
asset) with the message "Updated hero logo to use a larger image".
The Landing_Page_Carries_The_House_Style_Surfaces fixture asserted
`Does.EndWith("/logo.png")` against the hero-image src, which was
correct for the old asset but fails for the new larger asset.

Loosen the assertion to `Does.Match(@"/logo[^/]*\.png$")` so any
`/logo*.png` variant satisfies it. Survives future asset swaps in
the same shape (e.g. `/logo-xl.png`, `/logo-dark.png`) without
another test edit. The nav-title, favicon, and social-card
assertions continue to pin the specific `/logo.png` path.
This is often used for messages and program names. SHDR should pass the value as is to the Agent and the Agent should then decide (based on validation level) whether to accept the value or not.
Although, based on the MTConnect Standard, a value should never be 'empty', an 'empty' value should be able to be accepted as many adpaters/agents don't adhere to this restriction and could cause issues with real world implementations.

An InputValidationLevel set to 'strict' should rewrite an 'empty' value as 'UNAVAILABLE' so that it strictly conforms to the standard.
…nectDevices validation. This allows a device to be validated at a different level than observations/assets
ottobolyos added a commit to ottobolyos/mtconnect.net that referenced this pull request Jul 15, 2026
Adds a reflection-based fixture under
tests/MTConnect.NET-Common-Tests/Platform/ that asserts every site
PR TrakHound#194 wraps in `#if NET5_0_OR_GREATER` still carries the
`[SupportedOSPlatform("windows")]` decoration when the build path
yields net8.0. The fixture covers the six sites from the May-22
warnings sweep — WindowsService, MTConnectAgentService,
MTConnectAdapterService, both `MTConnect.Applications.Service`
types (agent + adapter), and the
`Ceen.Httpd.HttpServer.AppDomainBridge.HandleRequest(SocketInformation,...)`
plus `HttpServer.RunClient(SocketInformation,...)` HTTP-server
sites — and pins the API surface so a future contributor who
removes the attribute or narrows the wrap fails the test.

The fixture runs only under net8.0 (the only TFM every test project
targets), so cannot directly fail under the pre-fix code. Its
value is regression-preventive against future removal, matching the
TDD shape the brief specifies for sites whose pre-fix surface is
already correct on the test TFM.

Extends the test csproj with reflection-only references to
MTConnect.NET-Services, MTConnect.NET-HTTP,
MTConnect.NET-Applications-Agents, and
MTConnect.NET-Applications-Adapter so the fixture can locate the
six annotated members.
ottobolyos added a commit to ottobolyos/mtconnect.net that referenced this pull request Jul 15, 2026
Adds a fixture under tests/MTConnect.NET-XML-Tests/Xml/ that
exercises XsdPreprocessor.StripXsd11Constructs — the production site
that uses the C# 8.0 `using var reader = ...;` declaration. On
netstandard2.0 the compiler's default LangVersion is 7.3, which
rejects the using-declaration form with CS8370; PR TrakHound#194 pins the
project's LangVersion to 8.0. The fixture runs only under net8.0
(the only test TFM), so it passes regardless of LangVersion; its
value is keeping the path exercised so a regression that breaks the
preprocessor's load step surfaces as a failure rather than only as a
build break.
@ottobolyos ottobolyos force-pushed the fix/multi-tfm-compat branch from ecd5542 to f4e158f Compare July 15, 2026 20:54
ottobolyos added a commit to ottobolyos/mtconnect.net that referenced this pull request Jul 15, 2026
Adds a structural test under
tests/MTConnect.NET-AgentModule-MqttRelay-Tests/ that scans
Module.cs for the shadowing `foreach (var observation in ...)`
declaration inside AgentObservationAdded. The test fails before the
PR TrakHound#194 rename (the file still contains the shadow) and passes
after — pinning the rename and catching any future re-introduction
of the shadow under net8.0, which is the only TFM the CI matrix
exercises directly.

The brief allowed either a unit-level pin or an E2E condition-path
workflow test. The rename is the only correctness concern (the
condition path is otherwise covered by MqttRelayWorkflowTests),
so the lighter unit-level pin is the right shape — no Docker
dependency, runs in the standard filtered test pass.
The new `DeviceValidationLevel` property + enum added on this branch adds
one config key row to `IAgentConfiguration` and `AgentConfiguration`; the
drift gate `docs/scripts/generate-reference.sh --check` reports DRIFT
until the generated `docs/reference/configuration.md` catches up. Runs
the generator to produce the current output.
ottobolyos added a commit to ottobolyos/mtconnect.net that referenced this pull request Jul 15, 2026
Adds a reflection-based fixture under
tests/MTConnect.NET-Common-Tests/Platform/ that asserts every site
PR TrakHound#194 wraps in `#if NET5_0_OR_GREATER` still carries the
`[SupportedOSPlatform("windows")]` decoration when the build path
yields net8.0. The fixture covers the six sites from the May-22
warnings sweep — WindowsService, MTConnectAgentService,
MTConnectAdapterService, both `MTConnect.Applications.Service`
types (agent + adapter), and the
`Ceen.Httpd.HttpServer.AppDomainBridge.HandleRequest(SocketInformation,...)`
plus `HttpServer.RunClient(SocketInformation,...)` HTTP-server
sites — and pins the API surface so a future contributor who
removes the attribute or narrows the wrap fails the test.

The fixture runs only under net8.0 (the only TFM every test project
targets), so cannot directly fail under the pre-fix code. Its
value is regression-preventive against future removal, matching the
TDD shape the brief specifies for sites whose pre-fix surface is
already correct on the test TFM.

Extends the test csproj with reflection-only references to
MTConnect.NET-Services, MTConnect.NET-HTTP,
MTConnect.NET-Applications-Agents, and
MTConnect.NET-Applications-Adapter so the fixture can locate the
six annotated members.
ottobolyos added a commit to ottobolyos/mtconnect.net that referenced this pull request Jul 15, 2026
Adds a fixture under tests/MTConnect.NET-XML-Tests/Xml/ that
exercises XsdPreprocessor.StripXsd11Constructs — the production site
that uses the C# 8.0 `using var reader = ...;` declaration. On
netstandard2.0 the compiler's default LangVersion is 7.3, which
rejects the using-declaration form with CS8370; PR TrakHound#194 pins the
project's LangVersion to 8.0. The fixture runs only under net8.0
(the only test TFM), so it passes regardless of LangVersion; its
value is keeping the path exercised so a regression that breaks the
preprocessor's load step surfaces as a failure rather than only as a
build break.
ottobolyos added a commit to ottobolyos/mtconnect.net that referenced this pull request Jul 15, 2026
Adds a structural test under
tests/MTConnect.NET-AgentModule-MqttRelay-Tests/ that scans
Module.cs for the shadowing `foreach (var observation in ...)`
declaration inside AgentObservationAdded. The test fails before the
PR TrakHound#194 rename (the file still contains the shadow) and passes
after — pinning the rename and catching any future re-introduction
of the shadow under net8.0, which is the only TFM the CI matrix
exercises directly.

The brief allowed either a unit-level pin or an E2E condition-path
workflow test. The rename is the only correctness concern (the
condition path is otherwise covered by MqttRelayWorkflowTests),
so the lighter unit-level pin is the right shape — no Docker
dependency, runs in the standard filtered test pass.
@ottobolyos ottobolyos force-pushed the fix/multi-tfm-compat branch from f4e158f to cb71ee5 Compare July 15, 2026 20:58
Commit 8dd28c6 narrowed the empty-Result coerce guard on
`MTConnectAgent.AddObservation` from unconditional to
`InputValidationLevel == Strict`-only. On the three other levels
(`Ignore`, `Warning`, `Remove`) a null / empty-string / whitespace-only
Result then flowed verbatim onto every wire transport, contradicting the
MTConnect Part 1 mandate this repo already encodes verbatim as
`Observation.UnavailableDescription`:

    If an Agent cannot determine a Valid Data Value for a DataItem, the
    value returned for the Result for the Data Entity MUST be reported
    as UNAVAILABLE.

The empty string is not a Valid Data Value under any typed DataItem
schema — `MTConnectStreams_*.xsd` enumerates `UNAVAILABLE` as a schema
token, never as an empty content model; `xs:decimal` samples reject the
empty lexical form outright; cppagent, the reference implementation,
coerces or rejects empty Results at ingress.

Restores the pre-8dd28c6b guard: coerce fires whenever the item is
non-CONDITION and the Result is empty, regardless of validation level.
Strict still gains the original benefit — the empty observation lands
rather than being silently dropped by the validator. The 8 red tests on
`AddObservation_NullEmptyOrWhitespaceResult_Coerced_To_Unavailable` were
pinning exactly this contract and go green with the restored guard.
Adds a reflection-based fixture under
tests/MTConnect.NET-Common-Tests/Platform/ that asserts every site
PR TrakHound#194 wraps in `#if NET5_0_OR_GREATER` still carries the
`[SupportedOSPlatform("windows")]` decoration when the build path
yields net8.0. The fixture covers the six sites from the May-22
warnings sweep — WindowsService, MTConnectAgentService,
MTConnectAdapterService, both `MTConnect.Applications.Service`
types (agent + adapter), and the
`Ceen.Httpd.HttpServer.AppDomainBridge.HandleRequest(SocketInformation,...)`
plus `HttpServer.RunClient(SocketInformation,...)` HTTP-server
sites — and pins the API surface so a future contributor who
removes the attribute or narrows the wrap fails the test.

The fixture runs only under net8.0 (the only TFM every test project
targets), so cannot directly fail under the pre-fix code. Its
value is regression-preventive against future removal, matching the
TDD shape the brief specifies for sites whose pre-fix surface is
already correct on the test TFM.

Extends the test csproj with reflection-only references to
MTConnect.NET-Services, MTConnect.NET-HTTP,
MTConnect.NET-Applications-Agents, and
MTConnect.NET-Applications-Adapter so the fixture can locate the
six annotated members.
Adds a fixture under tests/MTConnect.NET-XML-Tests/Xml/ that
exercises XsdPreprocessor.StripXsd11Constructs — the production site
that uses the C# 8.0 `using var reader = ...;` declaration. On
netstandard2.0 the compiler's default LangVersion is 7.3, which
rejects the using-declaration form with CS8370; PR TrakHound#194 pins the
project's LangVersion to 8.0. The fixture runs only under net8.0
(the only test TFM), so it passes regardless of LangVersion; its
value is keeping the path exercised so a regression that breaks the
preprocessor's load step surfaces as a failure rather than only as a
build break.
Adds a structural test under
tests/MTConnect.NET-AgentModule-MqttRelay-Tests/ that scans
Module.cs for the shadowing `foreach (var observation in ...)`
declaration inside AgentObservationAdded. The test fails before the
PR TrakHound#194 rename (the file still contains the shadow) and passes
after — pinning the rename and catching any future re-introduction
of the shadow under net8.0, which is the only TFM the CI matrix
exercises directly.

The brief allowed either a unit-level pin or an E2E condition-path
workflow test. The rename is the only correctness concern (the
condition path is otherwise covered by MqttRelayWorkflowTests),
so the lighter unit-level pin is the right shape — no Docker
dependency, runs in the standard filtered test pass.
Restores Release pack-ability across the full TFM matrix
(net461..net9.0 + netstandard2.0). Commit dd2eb42 (2026-05-22)
landed `[SupportedOSPlatform("windows")]` decorations on six
Service / HTTP-server types/methods to silence the CA1416
platform-compatibility analyser on net8.0. The attribute type
ships in System.Runtime on .NET 5.0+ but is absent from net4x and
netstandard2.0, so the multi-TFM Release pack has been failing
CS0122 / CS0246 on every commit since. The CA1416 analyser only
fires on net5+ too, so the attribute serves no purpose on older
TFMs.

Wraps each `using System.Runtime.Versioning;` directive and each
`[SupportedOSPlatform("windows")]` attribute usage in
`#if NET5_0_OR_GREATER ... #endif` so the older TFMs see neither.
No runtime behaviour change on .NET 5.0+ — the decoration remains
in effect — and net4x / netstandard2.0 stop referencing a type
that does not ship there.

Sites covered:
  * libraries/MTConnect.NET-Services/WindowsService.cs
  * libraries/MTConnect.NET-Services/MTConnectAgentService.cs
  * libraries/MTConnect.NET-Services/MTConnectAdapterService.cs
  * libraries/MTConnect.NET-HTTP/Ceen/Httpd/HttpServer.cs (two
    attribute sites — AppDomainBridge.HandleRequest and
    HttpServer.RunClient overloads that take SocketInformation)
  * agent/MTConnect.NET-Applications-Agents/Service.cs
  * adapter/MTConnect.NET-Applications-Adapter/Service.cs

The SupportedOSPlatformAttributePresenceTests fixture added in
the preceding test commit goes from RED on net8.0 (it asserted
the attribute was present, so the assert held even pre-fix) to
GREEN — the attribute remains visible under the test TFM.
XsdPreprocessor.StripXsd11Constructs uses a C# 8.0 `using var`
declaration:

    using var reader = new StringReader(xsdSourceXml);

The Roslyn default LangVersion on netstandard2.0 / net4x falls back
to 7.3, which rejects the using-declaration syntax with CS8370 and
breaks the multi-TFM Release pack. Pinning LangVersion to 8.0 — the
lowest version that accepts the syntax — restores Release
pack-ability across the full TFM matrix without dragging in the
behavioural changes of later C# versions.

Directory.Build.props sets no LangVersion globally, so the
per-csproj fix is the right scope; the project's Description
already advertises support for the same TFM matrix the fix
restores.
@ottobolyos ottobolyos force-pushed the fix/multi-tfm-compat branch from cb71ee5 to 5327dc8 Compare July 16, 2026 07:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

2 participants