Skip to content

Migrate to .NET 10#2444

Merged
marcschier merged 10 commits into
mainfrom
net10migration
May 13, 2026
Merged

Migrate to .NET 10#2444
marcschier merged 10 commits into
mainfrom
net10migration

Conversation

@marcschier
Copy link
Copy Markdown
Collaborator

@marcschier marcschier commented May 12, 2026

Migrate to .NET 10

Migrates the repository from .NET 9 to .NET 10. Build is clean (0 errors), all 4 in-slnx test projects pass on both Linux and Windows CI, plus all 23 out-of-slnx projects (e2e-tests + 22 samples + Netcap) build clean.

Highlights

  • TargetFramework net9.0net10.0 across all 36 .csproj files (src/, tests, e2e-tests, samples/Http|IoTHub|Mqtt|Netcap, tools).
  • Furly.* packages 1.1.56 → 1.2.1 (14 packages, all shipping lib/net10.0/).
  • Microsoft.Extensions.*, Microsoft.AspNetCore.Mvc.Testing, System.Text.Json, System.IO.Pipelines 9.0.x → 10.0.7.
  • Microsoft.Extensions.Diagnostics.ResourceMonitoring 9.10.0 → 10.5.0.
  • OpenTelemetry.* 1.14.0 → 1.15.x — addresses CVE advisories surfaced by .NET 10's transitive vuln audit (GHSA-g94r-2vxg-569j, GHSA-4625-4j76-fww9, GHSA-mr8r-92fq-pj8p, GHSA-q834-8qmm-v933).
  • System.Linq.Async 6.0.3 → 7.0.0 in Netcap (other projects already at 7.0.0).
  • ContainerBaseImage aspnet/runtime:9.0(-azurelinux3.0-distroless)10.0 equivalents.
  • Dockerfiles (samples/Netcap/src/Dockerfile): dotnet/aspnet:9.0 + dotnet/sdk:9.010.0.

CI

  • All pipelines now install both .NET 8 and .NET 10 SDKs. The .NET 8 SDK is required for the nbgv global tool which still ships only net8.0.
  • .github/workflows/test.yml hardened:
    • Added concurrency group with cancel-in-progress so superseded PR runs are aborted automatically.
    • Added 60-minute job timeout and --blame-hang-timeout 10m --blame-hang-dump-type none to surface hung tests instead of letting them run for hours.
    • fail-fast: false so a Windows failure no longer cancels the Linux signal.
    • Test projects are now executed serially to avoid OPC UA test-host contention on Windows runners (parallel dotnet test on the slnx caused intermittent test-host crashes due to concurrent OPC UA servers/PKI directories from BaseServerFixture).
  • tools/e2etesting/steps/runtests.yml: bumped from .NET 8 to .NET 10 (with .NET 8 still installed for nbgv).

.NET 10 source / behavior fix-ups

  • Removed <PackageReference> entries flagged by NU1510 as already provided by the shared framework: System.Text.Json, System.Net.Http, System.IO.Pipelines, System.Private.Uri, System.IO.FileSystem, System.Net.Primitives, System.Text.RegularExpressions, System.Security.Cryptography.X509Certificates, Microsoft.CSharp.
  • Dropped the deprecated IncludeOpenAPIAnalyzers property in common.props (ASPDEPR007).
  • Migrated SelectAwait in SimulatorNodesTests to the new built-in AsyncEnumerable.Select(value, CancellationToken) overload (replaces the now-obsolete community System.Linq.Async API).
  • Updated docs/opc-publisher/features.md feature matrix from .net 9 to .net 10.

Verification

  • dotnet restore Industrial-IoT.slnx — clean, no NU1510/NU1902 warnings.

  • dotnet build Industrial-IoT.slnx0 errors, 89 pre-existing CA-analyzer warnings.

  • All 23 out-of-slnx projects build cleanly individually.

  • dotnet build e2e-tests/IIoTPlatform-E2E-Tests.slnx — clean.

  • Tests (4 in-slnx test projects):

    Project Total Passed Skipped Failed
    Azure.IIoT.OpcUa.Publisher.Models.Tests 2259 2259 0 0
    Azure.IIoT.OpcUa.Tests 2155 2155 0 0
    Azure.IIoT.OpcUa.Publisher.Tests 846 846 0 0
    Azure.IIoT.OpcUa.Publisher.Module.Tests 1526 1447 79 0
    Total 6786 6707 79 0

Commits

  1. 0a1a117 — Prepare for .NET 10: drop internal NuGet feed and bump rc version
  2. 1de20b1 — Update TargetFramework from net9.0 to net10.0
  3. 2ca4de9 — Bump packages and container base images for .NET 10
  4. 4e5c9da — Resolve .NET 10 migration warnings
  5. e2ce578 — Bump CI workflows and docs to .NET 10
  6. b58e630 — Bump e2e-testing pipeline SDK to .NET 10
  7. 962f4ff — Install both .NET 8 and .NET 10 SDKs in CI pipelines
  8. 8c6a277 — Add timeout, hang-detection, and concurrency to Build and Test workflow
  9. 189c619 — Run test projects serially to avoid Windows OPC UA contention

marcschier and others added 7 commits May 12, 2026 12:37
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Furly.* 1.1.56 -> 1.2.1 (14 packages)
- Microsoft.Extensions.*, Microsoft.AspNetCore.Mvc.Testing,
  System.Text.Json, System.IO.Pipelines 9.0.x -> 10.0.7
- Microsoft.Extensions.Diagnostics.ResourceMonitoring 9.10.0 -> 10.5.0
- System.Linq.Async 6.0.3 -> 7.0.0 (Netcap)
- ContainerBaseImage tags aspnet/runtime:9.0(-distroless) -> 10.0
- Dockerfile: dotnet/aspnet:9.0 + dotnet/sdk:9.0 -> 10.0

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Remove NU1510-flagged PackageReferences now covered by the shared
  framework (System.Text.Json, System.Net.Http, System.IO.Pipelines,
  System.Private.Uri, System.IO.FileSystem, System.Net.Primitives,
  System.Text.RegularExpressions,
  System.Security.Cryptography.X509Certificates, Microsoft.CSharp).
- Bump OpenTelemetry packages 1.14.0 -> 1.15.x to address NU1902
  CVE advisories (GHSA-g94r-2vxg-569j, GHSA-4625-4j76-fww9,
  GHSA-mr8r-92fq-pj8p, GHSA-q834-8qmm-v933).
- Drop deprecated IncludeOpenAPIAnalyzers from common.props (ASPDEPR007).
- Migrate System.Linq.Async SelectAwait usage in SimulatorNodesTests
  to the new built-in AsyncEnumerable.Select(value, CancellationToken)
  overload (resolves CS0618).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- GitHub Actions setup-dotnet pinned 9.0.x -> 10.0.x in dotnet.yml,
  test.yml, codeql.yml
- Update OPC Publisher feature matrix to list .net 10 instead of .net 9

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Update tools/e2etesting/steps/runtests.yml UseDotNet@2 from 8.0.x to
10.0.x to match the migrated TargetFramework. The IIoTPlatform-E2E-Tests
slnx (e2e-tests/IIoTPlatform-E2E-Tests.slnx) and its three projects
(OpcUa.Publisher.Models, OpcUa.Publisher.Sdk, OpcPublisher-AE-E2E-Tests)
already build cleanly on net10.0; nbgv 3.9.50 rolls forward from
net8.0 to .NET 10 at runtime via rollForwardOnNoCandidateFx=Major.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
nbgv 3.9.50 (Nerdbank.GitVersioning tool) only ships net8.0 binaries.
Although its runtimeconfig sets rollForwardOnNoCandidateFx=Major so it
would roll forward to .NET 10, explicitly installing the .NET 8 runtime
alongside .NET 10 is more robust and avoids surprises across hosted-
agent images.

- .github/workflows/{dotnet,test,codeql}.yml: setup-dotnet now installs
  both 8.0.x and 10.0.x. The last entry (10.0.x) becomes the default.
- tools/e2etesting/steps/runtests.yml: add a second UseDotNet@2 task
  installing 8.0.x before the 10.0.x task.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@marcschier marcschier requested a review from a team as a code owner May 12, 2026 14:24
koepalex
koepalex previously approved these changes May 12, 2026
- Add 60-minute job timeout (ubuntu completes in ~15min; windows had
  hung indefinitely on the Test step in PR #2444 run, suggesting a
  cross-process test fixture deadlock that only manifests on Windows).
- Add --blame-hang-timeout 10m so any hanging test surfaces a clear
  failure with the offending test name instead of hanging the runner.
- Add concurrency group with cancel-in-progress so superseded PR runs
  are stopped automatically.
- fail-fast: false so the ubuntu signal isn't lost if windows fails.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
marcschier and others added 2 commits May 12, 2026 18:51
The Industrial-IoT.slnx contains four test projects. dotnet test on the
slnx runs them as multiple parallel test-host processes. On Windows
runners, the OPC UA test fixtures (BaseServerFixture spins up real OPC
UA servers on random ports with per-process PKI stores) intermittently
contend on ports / PKI directories, leading to test-host process
crashes (Reason: 'Test host process crashed' / MSB4181 from VSTestTask).
ubuntu-latest does not exhibit the issue.

Run each test project sequentially in the same step. Each invocation
keeps the per-project parallelism (xUnit collection parallelism) but
avoids cross-project process contention.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@marcschier marcschier merged commit b22d8b6 into main May 13, 2026
7 of 9 checks passed
@marcschier marcschier deleted the net10migration branch May 13, 2026 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants