Skip to content

Migrate toolchain from net10.0 to net11.0 - #4163

Merged
Mpdreamz merged 8 commits into
mainfrom
chore/dotnet-11
Nov 11, 2026
Merged

Mpdreamz merged 8 commits into
mainfrom
chore/dotnet-11

Conversation

@Mpdreamz

@Mpdreamz Mpdreamz commented Sep 21, 2026 •

Copy link
Copy Markdown
Member

The whole toolchain moves from net10.0 to net11.0, pinned to the .NET 11 GA SDK 11.0.100. One shared <TargetFramework> replaces 60 per-project lines, and the container and Lambda images follow. .NET 11 was released at .NET Conf 2026.

Affects: API reference, Internals

Prompt summary: Migrate docs-builder to .NET 11, starting with the mechanics: centralize the TFM into Directory.Build.props, update global.json to the installed .NET 11 SDK, fix container images and Dockerfile install channels, update dotnet tools rollforward policy, and clear any new analyzer errors the upgrade surfaces in production code.

Why

Each project file pins <TargetFramework>net10.0</TargetFramework> itself, so a framework bump touches every file and can drift. Five dotnet tools set rollForward: false, so they fail to start on a runner that has only a .NET 11 runtime.

What

One shared target framework

Directory.Build.props sets net11.0 for every project, and the per-project <TargetFramework> lines are gone, including the one in the new Elastic.Authoring.Tests. global.json pins SDK 11.0.100 with rollForward: latestFeature; main's test.runner setting for Microsoft.Testing.Platform stays. The test stack is main's TUnit setup, so this PR adds no test-runner workarounds.

Container and Lambda images

build/Targets.fs publishes the containers on 11.0-noble-chiseled, and build/dev/Dockerfile uses the 11.0 SDK and runtime-deps images. The Lambda and API Dockerfiles keep main's --jsonfile global.json install, so they follow the pin and need no change here.

Tool rollforward and analyzer fixes

The five tools in dotnet-tools.json that had rollForward: false now roll forward. .NET 11 adds analyzer diagnostics that TreatWarningsAsErrors turns into errors; the fixes are small. They forward the cancellation token (CA2016), use Count > 0 over Any() (CA1860) and use [] over FrozenDictionary<K,V>.Empty (IDE0301). The NU1510 reference to Microsoft.Extensions.DependencyInjection.Abstractions is gone because the package is now inbox. An F# nullness error in build/Targets.fs is fixed too.

Swagger 2.0 specs without schemes

Microsoft.OpenApi 3.11.0 sets UriBuilder.Host = "//host" for a Swagger 2.0 spec that has a host but no schemes. .NET 11 rejects that value with an ArgumentException, so such specs stop loading. OpenApiReader now adds schemes: ["https"] in that case before it parses. On .NET 10 these specs got a file://host/ server URL, so the rendered server URL changes to https://host/.

Out of scope: an upstream fix in Microsoft.OpenApi. The reader workaround can go once a release handles .NET 11.

Verify

dotnet build
./build.sh unit-test
./build.sh lint

The `<TargetFramework>` is centralized into `Directory.Build.props` so the
60 individual project pins disappear. `global.json` pins the SDK at
`11.0.100-preview.7.26381.103` with `allowPrerelease: true`. Container base
images, `dotnet-install.sh` channels in the five Lambda/API Dockerfiles, and
`build/Targets.fs` follow the same bump.

`dotnet-tools.json` gains `rollForward: true` for the five tools that were
pinned to `rollForward: false`, so they survive on a runner that ships only
a .NET 11 runtime.

`Microsoft.Extensions.DependencyInjection.Abstractions` is removed from the
explicit references in `Elastic.Documentation.Search` — it became an inbox
assembly on .NET 11 and NuGet raises `NU1510` when it appears explicitly.

The test runner stack needs a coordinated upgrade: `xunit.v3` moves to
`3.2.2`, `Microsoft.Testing.Platform` and `Microsoft.Testing.Platform.MSBuild`
to `2.3.3`, and `Microsoft.Testing.Extensions.Telemetry` and
`Microsoft.Testing.Extensions.TrxReport.Abstractions` are pinned to `2.3.3`
as new explicit transitive pins. `MTP.MSBuild 2.x` blocks the VSTest path on
SDK 10+ via `_MTPBeforeVSTest`; a new `Directory.Build.targets` overrides
`IsTestingPlatformApplication` to `false` after all package targets have run,
so `xunit.runner.visualstudio` handles discovery and execution instead.

New .NET 11 analyzer diagnostics in production code are fixed where they
appear: `CA2016` (`CancellationToken` not forwarded in four `WriteLineAsync`
calls), `CA1860` (`Any()` replaced with `Count > 0` in two sites), and
`IDE0301` (`FrozenDictionary<K,V>.Empty` replaced with `[]` in five files).

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@Mpdreamz
Mpdreamz requested a review from a team as a code owner September 21, 2026 15:23
@Mpdreamz Mpdreamz added the chore label Sep 21, 2026
@Mpdreamz
Mpdreamz requested a review from technige September 21, 2026 15:23
Resolved conflicts:
- `FetchedReleaseNotes.cs`: kept the new `NotFoundDeclaredProducts` property
  from main; kept the `[]` initialization from our branch.
- `Elastic.Documentation.Api/Dockerfile`: took main's combined `RUN` layer
  (tar + findutils + dotnet-install in one step) and kept our `--channel 11.0`
  flag so .NET 11 is installed instead of the LTS default.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@github-actions

github-actions Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved.


What is this? | From workflow: PR Review

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.

Comment thread global.json Outdated
{
"sdk": {
"version": "10.0.100",
"version": "11.0.100-preview.7.26381.103",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"version": "11.0.100-preview.7.26381.103",
"version": "11.0.100-rc.1.26425.128",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apparently is supported for production, we can actually think to merge this

@akira28

akira28 commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

I guess we should wait for the GA release November  10, 2026

Pin 11.0.100-rc.3.26522.148, take main's TUnit/MTP test stack (drops the xunit
workarounds and Directory.Build.targets), drop the TFM from the new
Elastic.Authoring.Tests project, fix an F# nullness error in build/Targets.fs,
and default Swagger 2.0 specs with a host but no schemes to https because
Microsoft.OpenApi's UriBuilder.Host = "//host" is rejected by .NET 11.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Comment thread dotnet-tools.json Resolved
Comment thread global.json Resolved
Mpdreamz and others added 2 commits November 4, 2026 10:45
Treat an empty Swagger 2.0 schemes array like a missing one, with JSON and YAML
regression cases. Point README, CONTRIBUTING and the essc base image note at
.NET 11.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Take main's mise setup and its Lambda Dockerfiles, which install the SDK
from global.json and so follow the rc.3 pin. Drop the two project files
main deleted, and move the new shared testing project to the shared net11.0.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Comment thread build/dev/Dockerfile Resolved
Mpdreamz and others added 2 commits November 11, 2026 07:47
.NET 11 is released, so global.json drops the rc.3 pin and allowPrerelease.
The two projects main added since the last merge lose their own net10.0,
and docs-journeys forwards its cancellation token (CA2016).

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@Mpdreamz
Mpdreamz merged commit 52b70bf into main Nov 11, 2026
44 checks passed
@Mpdreamz
Mpdreamz deleted the chore/dotnet-11 branch November 11, 2026 07:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants