Summary
Drop the .NET 8 and .NET 9 target frameworks and consolidate GitVersion on .NET 10 (LTS), following the .NET 8 & 9 end-of-support announcement.
Per the announcement:
| Runtime |
Track |
End of support |
| .NET 9 |
STS |
November 10, 2026 |
| .NET 8 |
LTS |
November 10, 2026 |
| .NET 10 |
LTS |
November 2028 ✅ |
GitVersion currently multi-targets net8.0;net9.0;net10.0. Both .NET 8 and .NET 9 reach end of life on November 10, 2026, so 7.x (a major release) is the right time to drop both and target the current LTS, .NET 10, only.
⚠️ Breaking change
- The CLI / global tool will require the .NET 10 runtime.
GitVersion.MsBuild will ship only tools/net10.0. Consumers building net8.0/net9.0 projects will run the task via the existing dotnet --roll-forward Major shim (see GitVersion.MsBuild.targets), so a .NET 10 runtime must be available in the build environment. This should be verified as part of the work.
- Per-framework Docker images for
8.0/9.0 will no longer be produced.
What needs to change
Target frameworks
Source code (framework-conditional compilation)
MSBuild task packaging & selection
Build / CI matrix (drives test jobs and Docker images)
Verification
Notes
- The SDK is already
10.0.301 (global.json), so the toolchain is ready.
MicrosoftBuildVersion is pinned per-TFM to match each SDK's MSBuild; dropping the 8.0/9.0 pins removes that maintenance burden.
Summary
Drop the .NET 8 and .NET 9 target frameworks and consolidate GitVersion on .NET 10 (LTS), following the .NET 8 & 9 end-of-support announcement.
Per the announcement:
GitVersion currently multi-targets
net8.0;net9.0;net10.0. Both .NET 8 and .NET 9 reach end of life on November 10, 2026, so 7.x (a major release) is the right time to drop both and target the current LTS, .NET 10, only.GitVersion.MsBuildwill ship onlytools/net10.0. Consumers buildingnet8.0/net9.0projects will run the task via the existingdotnet --roll-forward Majorshim (seeGitVersion.MsBuild.targets), so a .NET 10 runtime must be available in the build environment. This should be verified as part of the work.8.0/9.0will no longer be produced.What needs to change
Target frameworks
src/Directory.Build.props:3—<TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks>→<TargetFramework>net10.0</TargetFramework>src/Directory.Packages.props:6-8— remove thenet8.0(17.11.48) andnet9.0(17.14.28)MicrosoftBuildVersionconditions; keep only thenet10.0value (18.7.1), which can then be unconditionalSource code (framework-conditional compilation)
src/GitVersion.Core/Core/RegexPatterns.cs— 47#if NET9_0_OR_GREATER / #else / #endifblocks. Thenet9.0+branch uses the partial-property[GeneratedRegex]form (public static partial Regex X { get; }); thenet8.0#elsebranch uses the older method form (private static partial Regex XImpl(); public static Regex X { get; } = XImpl();) because net8.0's regex source generator doesn't support partial properties. Oncenet8.0is gone, every#if NET9_0_OR_GREATERis always true — keep the partial-property branch and delete all 47#elsebranches plus the#if/#else/#endifdirectives. This is the only source file with TFM-conditional compilation (verified viagrep -rE "#if .*NET[0-9]" src new-cli).MSBuild task packaging & selection
src/GitVersion.MsBuild/GitVersion.MsBuild.csproj:42-43— remove thetools/net8.0andtools/net9.0<None Include=.../>packaging entries (keeptools/net10.0at:44)src/GitVersion.MsBuild/msbuild/tools/GitVersion.MsBuild.targets:12-16— remove thenet8.0andnet9.0GitVersionTargetFrameworkselection branches; keep thenet10.0branch and make the fallback resolve tonet10.0(currently falls back tonet8.0)Build / CI matrix (drives test jobs and Docker images)
build/common/Utilities/Constants.cs:10—DotnetVersions = [DotnetLtsLatest, "9.0", "8.0"]→[DotnetLtsLatest](i.e. just"10.0"). This single constant feeds:build/config/Tasks/SetMatrix.cs→_prepare.ymldotnet_versions→ theTest / <os> - net8.0|net9.0|net10.0jobs inci.yml/_unit_tests.ymlbuild/common/Lifetime/DockerBuildLifetime.cs:28,52net8.0/net9.0assumptions inbuild/artifacts/Tasks/ArtifactsMsBuild*Test.csand the docker tasks once the matrix is reducedVerification
grep -rn "net8\.0\|net9\.0" src new-cli build .githubreturns nothing meaningful (only intentional history/notes, if any)grep -rn "#if .*NET[0-9]" src new-clireturns nothing (all TFM-conditional compilation removed)dotnet build ./src/GitVersion.slnxand./new-cli/GitVersion.slnxbuild on net10.0 onlydotnet test ./src/GitVersion.slnxis green (matrix now net10.0 only)dotnet format --verify-no-changes ./src/GitVersion.slnxpassesGitVersion.MsBuildsmoke-tested against a consumer project targetingnet8.0(must still work via roll-forward to the net10.0 tools)net10.0imagesNotes
10.0.301(global.json), so the toolchain is ready.MicrosoftBuildVersionis pinned per-TFM to match each SDK's MSBuild; dropping the 8.0/9.0 pins removes that maintenance burden.