GitTools / GitTools/GitVersion

Add support for .NET 11

Open
#4,998 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature
Dominant language
C#
Stars
3.1k
Forks
659
Avg merge
13h 15m
Merged PRs (30d)
51

Description

Summary

Add .NET 11 to GitVersion's supported target frameworks.

.NET 11 is the next Standard Term Support (STS) release, currently in preview, with GA expected November 2026. GitVersion should target it so the CLI/global tool, the MSBuild task, and the Docker images run natively on .NET 11.

Relationship to the framework cleanup

This is additive and complements #4997 (drop .NET 8 / .NET 9). Combined end state:

Before After #4997 After #4997 + this
net8.0;net9.0;net10.0 net10.0 net10.0;net11.0

i.e. the current LTS (.NET 10) plus the latest STS (.NET 11) — mirroring how the project currently pairs an LTS with the newest releases.

Timing: .NET 11 is preview until ~November 2026. Targeting can be staged behind preview SDKs, but the stable bump should land once .NET 11 GAs. Re-milestone if 7.x ships before then.

What needs to change

SDK
  • global.json — bump sdk.version from 10.0.301 to the .NET 11 SDK (11.0.1xx) once available (the SDK targets all earlier runtimes, so this is safe ahead of dropping anything).
Target frameworks
  • src/Directory.Build.props:3 — add net11.0 to <TargetFrameworks> (e.g. net10.0;net11.0, accounting for #4997).
  • src/Directory.Packages.props — add a MicrosoftBuildVersion condition for '$(TargetFramework)' == 'net11.0' (the MSBuild/SDK version that ships with .NET 11), alongside the existing per-TFM entries.
MSBuild task packaging & selection
  • src/GitVersion.MsBuild/GitVersion.MsBuild.csproj — add a tools/net11.0 <None Include=.../> packaging entry mirroring the existing tools/net10.0 one (:44).
  • src/GitVersion.MsBuild/msbuild/tools/GitVersion.MsBuild.targets — add a net11.0 GitVersionTargetFramework selection branch consistent with the existing net9/net10 branches.
Build / CI matrix (drives test jobs and Docker images)
  • build/common/Utilities/Constants.cs:10 — add "11.0" to DotnetVersions (e.g. [DotnetLtsLatest, "11.0"]). This single constant feeds the CI unit-test matrix (SetMatrix.cs_prepare.ymlci.yml/_unit_tests.yml) and the Docker image matrix (DockerBuildLifetime.cs). Confirm Docker base images for net11.0 are available before enabling the Docker leg.
Source code
  • No changes expected. The only TFM-conditional code, src/GitVersion.Core/Core/RegexPatterns.cs, gates on #if NET9_0_OR_GREATER, which already includes net11.0 — the partial-property [GeneratedRegex] path applies automatically. (Verify nothing new is needed if .NET 11 deprecates/changes any used API.)

Acceptance criteria

  • dotnet build/dotnet test ./src/GitVersion.slnx pass with net11.0 in the matrix.
  • dotnet format --verify-no-changes ./src/GitVersion.slnx passes.
  • GitVersion.MsBuild smoke-tested against a net11.0 consumer project.
  • Docker images produced for net11.0 (once base images exist).
  • No analyzer/obsolete warnings introduced by the .NET 11 SDK/runtime.
  • Docs / release notes mention .NET 11 support.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with global.json, src/Directory.Build.props, src/Directory.Packages.props, GitVersion.MsBuild.csproj, its targets file, and build/common/Utilities/Constants.cs. Run the solution build and tests, then verify formatting and the MSBuild smoke test. Done means the net11.0 matrix, packaging, CI, Docker images, and documentation meet the listed acceptance criteria without new warnings.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, docker
Domain
build-system, ci-cd, devops, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.