Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
f61206c
Build and test with .NET 10
martincostello Aug 12, 2025
fff14d8
Update to .NET 10 preview 7
martincostello Aug 12, 2025
70ce1f0
Update Cake.Sdk
martincostello Aug 14, 2025
81819c4
Update to .NET 10 RC1
martincostello Sep 9, 2025
b38313c
Fix mutation tests
martincostello Sep 9, 2025
89e79be
Remove workaround
martincostello Sep 9, 2025
13e13b3
Update Cake.Sdk
martincostello Sep 11, 2025
6fdfc0a
Update Cake.Sdk
martincostello Sep 15, 2025
26706a0
Use Preview language-version
martincostello Sep 15, 2025
d4d9346
Update .NET SDK (#2768)
polly-updater-bot[bot] Oct 14, 2025
8ca7aff
Update NuGet packages
martincostello Oct 14, 2025
423eb21
Fix Cake warnings
martincostello Oct 15, 2025
0eb4994
Try to fix mutation tests
martincostello Oct 15, 2025
0dab439
Update stryker TFM
martincostello Oct 18, 2025
c718c12
Update Cake.Sdk
martincostello Oct 31, 2025
dca4832
Update Newtonsoft.Json version to 13.0.4
martincostello Oct 31, 2025
7c7f66c
Merge branch 'main' into dotnet-vnext
martincostello Oct 31, 2025
9fd795a
Update to .NET 10 RTM
martincostello Oct 18, 2025
7b56f75
Merge branch 'main' into dotnet-vnext
martincostello Nov 11, 2025
f992122
Update Cake.Sdk
martincostello Nov 12, 2025
0f93f89
Merge branch 'main' into dotnet-vnext
martincostello Nov 20, 2025
1f24297
Fix build
martincostello Nov 23, 2025
7254a86
Merge branch 'main' into dotnet-vnext
martincostello Dec 4, 2025
e7efbc5
Merge branch 'main' into dotnet-vnext
martincostello Dec 5, 2025
38fd2f2
Merge branch 'main' into dotnet-vnext
martincostello Dec 18, 2025
4c68b38
Set language version preview
martincostello Dec 18, 2025
0acfd64
Fix GitHub step summaries
martincostello Dec 18, 2025
bdbf75f
Bump M.E.TimeProvider.Testing
martincostello Dec 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<PackageVersion Include="Microsoft.Extensions.Http.Resilience" Version="10.1.0" />
<PackageVersion Include="Microsoft.Extensions.Logging.Console" Version="9.0.10" />
<PackageVersion Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="9.0.10" />
<PackageVersion Include="Microsoft.Extensions.TimeProvider.Testing" Version="9.8.0" />
<PackageVersion Include="Microsoft.Extensions.TimeProvider.Testing" Version="10.1.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
<PackageVersion Include="MinVer" Version="6.0.0" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.4" />
Expand All @@ -36,7 +36,6 @@
<PackageVersion Include="SonarAnalyzer.CSharp" Version="10.17.0.131074" />
<PackageVersion Include="StyleCop.Analyzers" Version="1.2.0-beta.556" />
<PackageVersion Include="System.ComponentModel.Annotations" Version="4.5.0" />
<PackageVersion Include="System.Text.Json" Version="9.0.10" />
<PackageVersion Include="System.Threading.Tasks.Extensions" Version="4.5.4" />
<PackageVersion Include="System.ValueTuple" Version="4.5.0" />
<PackageVersion Include="xunit" Version="2.9.3" />
Expand All @@ -59,4 +58,12 @@
<PackageVersion Update="System.Diagnostics.DiagnosticSource" Version="9.0.0" />
<PackageVersion Update="System.Threading.RateLimiting" Version="9.0.0" />
</ItemGroup>
<ItemGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible($(TargetFramework), 'net10.0'))">
<PackageVersion Update="Microsoft.Bcl.TimeProvider" Version="10.0.0" />
<PackageVersion Update="Microsoft.Extensions.Logging" Version="10.0.0" />
<PackageVersion Update="Microsoft.Extensions.Logging.Abstractions" Version="10.0.0" />
<PackageVersion Update="Microsoft.Extensions.Options" Version="10.0.0" />
<PackageVersion Update="System.Diagnostics.DiagnosticSource" Version="10.0.0" />
<PackageVersion Update="System.Threading.RateLimiting" Version="10.0.0" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion bench/Polly.Benchmarks/Polly.Benchmarks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<IsPackable>false</IsPackable>
<OutputType>Exe</OutputType>
<TargetFrameworks>net9.0;net8.0</TargetFrameworks>
<TargetFrameworks>net10.0;net9.0;net8.0</TargetFrameworks>
<Nullable>enable</Nullable>
<ProjectType>Benchmark</ProjectType>
<NoWarn>$(NoWarn);CA1822;IDE0060</NoWarn>
Expand Down
2 changes: 1 addition & 1 deletion bench/Polly.Core.Benchmarks/Polly.Core.Benchmarks.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net9.0;net8.0</TargetFrameworks>
<TargetFrameworks>net10.0;net9.0;net8.0</TargetFrameworks>
<RootNamespace>Polly</RootNamespace>
<ImplicitUsings>true</ImplicitUsings>
<ProjectType>Benchmark</ProjectType>
Expand Down
2 changes: 1 addition & 1 deletion bench/benchmarks.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ if ($Interactive -ne $true) {

$project = Join-Path "Polly.Core.Benchmarks" "Polly.Core.Benchmarks.csproj"

dotnet run --configuration $Configuration --framework net9.0 --project $project $additionalArgs
dotnet run --configuration $Configuration --framework net10.0 --project $project $additionalArgs

exit $LASTEXITCODE
4 changes: 2 additions & 2 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ https://cakebuild.net
#>

Param(
[string]$Script = "build.cake",
[string]$Script = "cake.cs",
[string]$Target = "Default",
[ValidateSet("Default", "MutationCore", "MutationLegacy")]
[string]$Configuration = "Release",
Expand Down Expand Up @@ -82,6 +82,6 @@ if ($WhatIf.IsPresent) {
# Start Cake
Write-Output "Running build script..."

& dotnet cake $Script "--target=$Target" "--configuration=$Configuration" "--verbosity=$Verbosity" $additionalArgs
& dotnet $Script -- "--target=$Target" "--configuration=$Configuration" "--verbosity=$Verbosity" $additionalArgs

exit $LASTEXITCODE
20 changes: 7 additions & 13 deletions build.cake → cake.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
#:sdk Cake.Sdk
#:package Cake.FileHelpers
#:package Newtonsoft.Json
#:property ProjectType=Test
#:property SignAssembly=false

///////////////////////////////////////////////////////////////////////////////
// ARGUMENTS
///////////////////////////////////////////////////////////////////////////////

var target = Argument<string>("target", "Default");
var configuration = Argument<string>("configuration", "Release");

//////////////////////////////////////////////////////////////////////
// EXTERNAL NUGET LIBRARIES
//////////////////////////////////////////////////////////////////////

#addin nuget:?package=Cake.FileHelpers&version=7.0.0
#addin nuget:?package=Newtonsoft.Json&version=13.0.3

///////////////////////////////////////////////////////////////////////////////
// GLOBAL VARIABLES
///////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -144,7 +143,7 @@
loggers =
[
"junit;LogFilePath=junit.xml",
"GitHubActions;report-warnings=false",
"GitHubActions;report-warnings=false;summary-include-passed=false",
];
}

Expand Down Expand Up @@ -285,11 +284,6 @@
// HELPER FUNCTIONS
//////////////////////////////////////////////////////////////////////

string ToolsExePath(string exeFileName) {
var exePath = System.IO.Directory.GetFiles("./tools", exeFileName, SearchOption.AllDirectories).FirstOrDefault();
return exePath;
}

string PatchStrykerConfig(string path, Action<Newtonsoft.Json.Linq.JObject> patch)
{
var json = System.IO.File.ReadAllText(path);
Expand Down
3 changes: 2 additions & 1 deletion eng/stryker-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
],
"concurrency": 4,
"configuration": "Debug",
"target-framework": "net8.0",
"language-version": "Preview",
"target-framework": "net10.0",
"thresholds": {
"high": 100,
"low": 100
Expand Down
5 changes: 4 additions & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
{
"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.

"allowPrerelease": false,
"rollForward": "latestMinor"
},
"msbuild-sdks": {
"Cake.Sdk": "6.0.0"
}
}
3 changes: 1 addition & 2 deletions samples/Chaos/Chaos.csproj
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<RootNamespace>Chaos</RootNamespace>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Http.Resilience" />
<PackageReference Include="Polly.Core" />
<PackageReference Include="System.Text.Json" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion samples/DependencyInjection/DependencyInjection.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion samples/Extensibility/Extensibility.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion samples/GenericPipelines/GenericPipelines.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion samples/Intro/Intro.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion samples/Retries/Retries.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
10 changes: 6 additions & 4 deletions src/Polly/Context.Dictionary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ public partial class Context : IDictionary<string, object>, IDictionary, IReadOn
// For an individual execution through a policy or policywrap, it is expected that all execution steps (for example executing the user delegate, invoking policy-activity delegates such as onRetry, onBreak, onTimeout etc) execute sequentially.
// Therefore, this class is intentionally not constructed to be safe for concurrent access from multiple threads.

private Dictionary<string, object> _wrappedDictionary;

private Dictionary<string, object> WrappedDictionary => _wrappedDictionary ?? (_wrappedDictionary = []);
private Dictionary<string, object> WrappedDictionary
{
get => field ??= [];
set;
}

/// <summary>
/// Initializes a new instance of the <see cref="Context"/> class, with the specified <paramref name="operationKey" /> and the supplied <paramref name="contextData"/>.
Expand All @@ -32,7 +34,7 @@ internal Context(IDictionary<string, object> contextData)
throw new ArgumentNullException(nameof(contextData));
}

_wrappedDictionary = new Dictionary<string, object>(contextData);
WrappedDictionary = new Dictionary<string, object>(contextData);
}

#region IDictionary<string,object> implementation
Expand Down
3 changes: 1 addition & 2 deletions src/Snippets/Snippets.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<ProjectType>Library</ProjectType>
<RootNamespace>Snippets</RootNamespace>
<SignAssembly>false</SignAssembly>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand All @@ -32,7 +32,6 @@
<PackageReference Include="NSubstitute" />
<PackageReference Include="Refit.HttpClientFactory" />
<PackageReference Include="RestSharp" />
<PackageReference Include="System.Text.Json" />
<PackageReference Include="xunit" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion test/Polly.AotTest/Polly.AotTest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<PublishAot>true</PublishAot>
<SKIP_POLLY_ANALYZERS>true</SKIP_POLLY_ANALYZERS>
<SelfContained>true</SelfContained>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\Polly.Core\Polly.Core.csproj" />
Expand Down
2 changes: 1 addition & 1 deletion test/Polly.Core.Tests/Polly.Core.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net9.0;net8.0</TargetFrameworks>
<TargetFrameworks>net10.0;net9.0;net8.0</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('Windows'))">$(TargetFrameworks);net481</TargetFrameworks>
<TestTfmsInParallel Condition="$([MSBuild]::IsOSPlatform('Windows'))">false</TestTfmsInParallel>
<ProjectType>Test</ProjectType>
Expand Down
2 changes: 1 addition & 1 deletion test/Polly.Extensions.Tests/Polly.Extensions.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net9.0;net8.0</TargetFrameworks>
<TargetFrameworks>net10.0;net9.0;net8.0</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('Windows'))">$(TargetFrameworks);net481</TargetFrameworks>
<ProjectType>Test</ProjectType>
<Nullable>enable</Nullable>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net9.0;net8.0</TargetFrameworks>
<TargetFrameworks>net10.0;net9.0;net8.0</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('Windows'))">$(TargetFrameworks);net481</TargetFrameworks>
<ProjectType>Test</ProjectType>
<Nullable>enable</Nullable>
Expand Down
8 changes: 3 additions & 5 deletions test/Polly.Specs/Helpers/Bulkhead/TraceableAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,13 @@ public class TraceableAction(int id, AutoResetEvent statusChanged, ITestOutputHe
private readonly CancellationTokenSource _cancellationSource = new();
private readonly AutoResetEvent _statusChanged = statusChanged;

private TraceableActionStatus _status;

public TraceableActionStatus Status
{
get => _status;
get;
set
{
_status = value;
_testOutputHelper.WriteLine(_id + "Updated status to {0}, signalling AutoResetEvent.", _status);
field = value;
_testOutputHelper.WriteLine(_id + "Updated status to {0}, signalling AutoResetEvent.", field);
SignalStateChange();
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/Polly.Specs/Polly.Specs.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net9.0;net8.0</TargetFrameworks>
<TargetFrameworks>net10.0;net9.0;net8.0</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('Windows'))">$(TargetFrameworks);net481</TargetFrameworks>
<Nullable>enable</Nullable>
<ProjectType>Test</ProjectType>
Expand Down
2 changes: 1 addition & 1 deletion test/Polly.TestUtils/Polly.TestUtils.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net9.0;net8.0</TargetFrameworks>
<TargetFrameworks>net10.0;net9.0;net8.0</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('Windows'))">$(TargetFrameworks);net481</TargetFrameworks>
<ProjectType>Library</ProjectType>
<Nullable>enable</Nullable>
Expand Down
2 changes: 1 addition & 1 deletion test/Polly.Testing.Tests/Polly.Testing.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net9.0;net8.0</TargetFrameworks>
<TargetFrameworks>net10.0;net9.0;net8.0</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('Windows'))">$(TargetFrameworks);net481</TargetFrameworks>
<ProjectType>Test</ProjectType>
<Nullable>enable</Nullable>
Expand Down
Loading