Skip to content

Target .NET 11 and drop .NET 8 and 9 - #4681

Merged
jbogard merged 3 commits into
mainfrom
net11
Nov 12, 2026
Merged

jbogard merged 3 commits into
mainfrom
net11

Conversation

@jbogard

@jbogard jbogard commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Adds .NET 11 support for the next major version, AutoMapper 17.0, building against the .NET 11 GA SDK. Part of #4679, which stays open until 17.0 ships.

Changes

  • Target frameworks: the package now targets netstandard2.0, net10.0, net11.0 and net471 (Windows). net8.0 and net9.0 are gone.
  • Tests: unit, DI and integration tests run on both net10.0 and net11.0, and unit tests also run on net471.
  • Versioning: MinVerMinimumMajorMinor is 17.0, so main now builds 17.0.0-preview packages.
  • CI: builds use the 11.0.x SDK (11.0.100 at GA). CI also runs on release/**.
  • Publishing: release.yml uses NuGet/login for NuGet trusted publishing instead of AUTOMAPPER_NUGET_API_KEY.
  • API compatibility: CompatibilitySuppressions.xml is regenerated on Windows against the 16.0.0 baseline. The only new kind of entry is CP0008 on the MemberList enum, from comparing the old net8.0 and net9.0 builds with netstandard2.0.
  • Docs: adds a 17.0 upgrade guide, which also says 15.x support ends with this release.

Why .NET 8 stays in the Windows jobs

The Windows jobs still install the 8.0.x SDK, only to provide a runtime for tools. No project targets it.

Microsoft.Sbom.DotNetTool 4.1.5 targets net8.0. Forced onto .NET 10, it still exits 0 but hits a serialization error during its component scan. In a local comparison it produced an SBOM with 1 package instead of 49, so rolling forward would silently ship incomplete SBOMs. NuGetKeyVaultSignTool keeps .NET 8 too, so that main and releases sign on the same runtime as before.

Testing

Platform Frameworks Tests per framework Result
macOS, GA SDK (11.0.100) net10.0, net11.0 33 DI, 1,306 unit, 133 integration All passed
Windows 11 VM, RC3 SDK net10.0, net11.0 33 DI, 1,306 unit All passed
Windows 11 VM, RC3 SDK net471 1,302 unit All passed

A clean Windows pack also passes package validation with the regenerated suppressions. The Windows VM runs used RC3; on the GA SDK, Windows is covered by CI, which runs the same tests and pack.

Not tested: NuGet/login and the push can only run from a real tag, so trusted publishing is unproven until the first release. Signing only runs on main.

Before releasing 17.0

  • Add a nuget.org trusted publishing policy: owner LuckyPennySoftware, repository AutoMapper, workflow release.yml
  • Add a NUGET_USER repository secret with the nuget.org profile name (not an email address)
  • Move CI and release workflows from RC3 to the .NET 11 GA SDK
  • After 17.0.0 ships, set PackageValidationBaselineVersion to 17.0.0 and regenerate the suppressions

Without the policy and secret, the NuGet login step fails and the release stops before pushing to nuget.org. Keep AUTOMAPPER_NUGET_API_KEY while release/16.x and release/15.x can still publish, because their workflows use it.

release/16.x already exists at v16.3.0, which is also the commit this branch starts from.

🤖 Generated with Claude Code

Add net11.0 and remove net8.0 and net9.0, and run the tests on both
net10.0 and net11.0. CI builds against the 11.0 RC3 SDK until GA.

Build main as 17.0 prereleases, run CI on release branches, and publish
to NuGet with trusted publishing instead of a long-lived API key.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 5, 2026 21:42
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-12T11:52:21.171414Z 37681eb New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a9aff1add3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/ci.yml Outdated
dotnet-version: |
8.0.x
9.0.x
8.0.x # Runtime for NuGetKeyVaultSignTool, matching release.yml

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Move SDK comments outside the multiline version input

In the Windows CI job, the # Runtime ... text is inside a YAML literal block, so it becomes part of the SDK version rather than a YAML comment. The setup-dotnet version resolver trims whitespace but rejects this string as an invalid version. Consequently, the Windows job stops at setup before building, testing, or publishing. The same defect appears in .github/workflows/release.yml at line 80 and blocks releases as well. Move both explanatory comments outside their dotnet-version blocks.

Useful? React with 👍 / 👎.

Copilot AI 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.

🟡 Changes recommended

Inline explanations in YAML literal blocks become part of the SDK version, causing setup-dotnet to reject the values and block Windows release and CI jobs.

1 open issue
What changed in this PR

Prepares AutoMapper 17.0 for .NET 11 as part of #4679, updating framework targets, build infrastructure, and upgrade guidance.

Changes:

  • Adds .NET 11 targets and test coverage, removes dedicated .NET 8/9 package targets, and sets 17.0 prerelease versioning.
  • Pins CI and release builds to the .NET 11 RC3 SDK, adds maintenance-branch CI, and switches NuGet publishing to trusted publishing.
  • Refreshes compatibility suppressions and documents framework compatibility and supported major versions.
File Description
src/​UnitTests/​AutoMapper.UnitTests.csproj Adds .NET 11 to unit test targets.
src/​TestApp/​TestApp.csproj Moves the test application to .NET 11.
src/​IntegrationTests/​AutoMapper.IntegrationTests.csproj Runs integration tests on .NET 10 and 11.
src/​Benchmark/​Benchmark.csproj Moves benchmarks to .NET 11.
src/​AutoMapper/​CompatibilitySuppressions.xml Refreshes suppressions for the revised framework targets.
src/​AutoMapper/​AutoMapper.csproj Updates package targets and sets minimum version to 17.0.
src/​AutoMapper.DI.Tests/​AutoMapper.DI.Tests.csproj Runs dependency injection tests on .NET 10 and 11.
docs/​source/​index.rst Links the 17.0 upgrade guide.
docs/​source/​17.0-Upgrade-Guide.md Explains framework fallback and the 17.x/16.x support window.
.github/​workflows/​release.yml Updates SDKs and introduces NuGet trusted publishing.
.github/​workflows/​ci.yml Updates SDKs and enables CI on maintenance branches.

Review effort: Balanced

Comment thread .github/workflows/release.yml Resolved
jbogard and others added 2 commits November 5, 2026 16:13
Text inside a YAML block scalar is part of the value, so setup-dotnet
rejected the inline comment as an invalid version.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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