Skip to content

Update to .NET 10 SDK#2531

Merged
martincostello merged 28 commits intomainfrom
dotnet-vnext
Dec 18, 2025
Merged

Update to .NET 10 SDK#2531
martincostello merged 28 commits intomainfrom
dotnet-vnext

Conversation

@martincostello
Copy link
Member

@martincostello martincostello commented Feb 26, 2025

Update to build and test with .NET 10. net10.0 is explicitly not being added as a new TFM for the packages we ship to NuGet.org.

Changes include:

  • Build with the .NET 10 SDK.
  • Add net10.0 to the test projects.
  • Use C# 14 features where relevant.
  • Use Cake.Sdk.

@martincostello martincostello added dependencies Pull requests that update a dependency file .NET Pull requests that update .NET code labels Feb 26, 2025
@codecov
Copy link

codecov bot commented Feb 26, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.15%. Comparing base (d7a9670) to head (bdbf75f).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2531   +/-   ##
=======================================
  Coverage   96.15%   96.15%           
=======================================
  Files         309      309           
  Lines        7127     7128    +1     
  Branches     1005     1005           
=======================================
+ Hits         6853     6854    +1     
  Misses        221      221           
  Partials       53       53           
Flag Coverage Δ
linux 96.15% <100.00%> (+<0.01%) ⬆️
macos 96.15% <100.00%> (+<0.01%) ⬆️
windows 96.14% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

martincostello added a commit that referenced this pull request Feb 27, 2025
Remove explicit reference to System.Text.Json as it should be redundant.

Identified by #2531.
martincostello added a commit that referenced this pull request Feb 27, 2025
Remove explicit reference to System.Text.Json as it should be redundant.

Identified by #2531.
martincostello added a commit that referenced this pull request May 16, 2025
Fix more IDE0055 warnings from #2531.
@martincostello martincostello force-pushed the dotnet-vnext branch 2 times, most recently from 2e22949 to e8b0126 Compare May 20, 2025 11:20
@martincostello martincostello force-pushed the dotnet-vnext branch 2 times, most recently from 847e149 to 20768ae Compare June 11, 2025 13:07
martincostello added a commit that referenced this pull request Jul 22, 2025
Cherry-pick changes from #2531 to sort package versions and add new references.
@martincostello martincostello mentioned this pull request Jul 22, 2025
martincostello added a commit that referenced this pull request Jul 22, 2025
Cherry-pick changes from #2531 to sort package versions and add new references.
@martincostello martincostello force-pushed the dotnet-vnext branch 2 times, most recently from 83c93f8 to f05acbd Compare July 24, 2025 14:10
@martincostello martincostello force-pushed the dotnet-vnext branch 3 times, most recently from 0d6763c to 0b3d12b Compare August 12, 2025 17:19
Update to latest beta version.
Fix build due to conflicting reference from Cake.Sdk.
Update to the stable version of .NET 10.
@martincostello
Copy link
Member Author

Depends on stryker-mutator/stryker-net#3327.

martincostello added a commit that referenced this pull request Nov 20, 2025
Suppress IDE0032 until Stryker supports .NET 10 and C# 14 and #2531 can be merged.
martincostello added a commit that referenced this pull request Nov 20, 2025
* Update .NET SDK

Update .NET SDK to version 9.0.308.

---
updated-dependencies:
- dependency-name: Microsoft.NET.Sdk
  dependency-version: 9.0.308
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: polly-updater-bot[bot] <138034000+polly-updater-bot[bot]@users.noreply.github.com>

* Suppress IDE0032

Suppress IDE0032 until Stryker supports .NET 10 and C# 14 and #2531 can be merged.

* Fix mutation tests

Try to prevent stryker from rolling forward to the .NET 10 SDK.

---------

Signed-off-by: polly-updater-bot[bot] <138034000+polly-updater-bot[bot]@users.noreply.github.com>
Co-authored-by: polly-updater-bot[bot] <138034000+polly-updater-bot[bot]@users.noreply.github.com>
Co-authored-by: Martin Costello <[email protected]>
martincostello added a commit that referenced this pull request Dec 4, 2025
Cherrypick some changes from #2531 while that is blocked on a new release of Stryker that supports .NET 10 GA.
martincostello added a commit that referenced this pull request Dec 4, 2025
Cherrypick some changes from #2531 while that is blocked on a new release of Stryker that supports .NET 10 GA.
@Frulfump
Copy link

Frulfump commented Dec 18, 2025

Depends on stryker-mutator/stryker-net#3327.

This is closed as completed now and a new version of Stryker is published, seems like there's been a few reported issues though.

Otherwise `field` generates an error.
@martincostello martincostello marked this pull request as ready for review December 18, 2025 18:42
Copilot AI review requested due to automatic review settings December 18, 2025 18:42
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the project to build and test with the .NET 10 SDK while maintaining backward compatibility. The update includes adopting C# 14 features and modernizing the build system with Cake.Sdk.

  • Updates .NET SDK from 9.0.308 to 10.0.100
  • Adds net10.0 target framework to test, benchmark, and sample projects
  • Adopts C# 14 semi-auto properties with field keyword
  • Migrates build scripts to use Cake.Sdk
  • Removes explicit System.Text.Json package references (included in .NET 10 framework)

Reviewed changes

Copilot reviewed 24 out of 24 changed files in this pull request and generated no comments.

Show a summary per file
File Description
global.json Updates SDK version to 10.0.100 and adds Cake.Sdk 6.0.0 reference
cake.cs Migrates to Cake.Sdk format with new directive syntax and removes unused helper function
build.ps1 Updates script name reference from build.cake to cake.cs and adjusts dotnet command invocation
bench/benchmarks.ps1 Updates benchmark framework target from net9.0 to net10.0
bench/Polly.Core.Benchmarks/Polly.Core.Benchmarks.csproj Adds net10.0 to target frameworks
bench/Polly.Benchmarks/Polly.Benchmarks.csproj Adds net10.0 to target frameworks
test/*.csproj (6 files) Adds net10.0 to test project target frameworks
test/Polly.AotTest/Polly.AotTest.csproj Updates single target framework from net9.0 to net10.0
samples/*.csproj (5 files) Updates sample project target frameworks from net9.0 to net10.0
src/Snippets/Snippets.csproj Updates target framework to net10.0 and removes System.Text.Json package reference
samples/Chaos/Chaos.csproj Updates target framework to net10.0 and removes System.Text.Json package reference
src/Polly/Context.Dictionary.cs Refactors to use C# 14 semi-auto property with field keyword
test/Polly.Specs/Helpers/Bulkhead/TraceableAction.cs Refactors Status property to use C# 14 semi-auto property with field keyword
Directory.Packages.props Removes System.Text.Json package version and adds net10.0-specific package version overrides
eng/stryker-config.json Updates target framework to net10.0 and sets language version to Preview

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Disable including passed tests to fix the step summaries being too large since the upgrade to GitHubActionsTestLogger v3.
Update to the latest release.
{
"sdk": {
"version": "9.0.308",
"version": "10.0.100",

This comment was marked as resolved.

Copy link
Member Author

Choose a reason for hiding this comment

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

I know - it's just an old PR as it was waiting on the stryker fix. Automation can update it post merge anyway.

Copy link
Member Author

Choose a reason for hiding this comment

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

@martincostello martincostello merged commit 42b05ff into main Dec 18, 2025
28 checks passed
@martincostello martincostello deleted the dotnet-vnext branch December 18, 2025 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file keep-open Prevents an issue or pull request from being marked as stale .NET Pull requests that update .NET code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants