diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 30e988ae560..e5bfa20acd4 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -91,7 +91,7 @@ jobs:
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with:
name: packages-${{ matrix.os_name }}
- path: ./artifacts/nuget-packages
+ path: ./artifacts/package/release
if-no-files-found: error
- name: Upload signing file list
diff --git a/Directory.Build.props b/Directory.Build.props
new file mode 100644
index 00000000000..c3398254fd3
--- /dev/null
+++ b/Directory.Build.props
@@ -0,0 +1,5 @@
+
+
+ true
+
+
diff --git a/Directory.Packages.props b/Directory.Packages.props
index e8b9af959fb..fb622139459 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -1,6 +1,6 @@
- 7.0.0
+ 8.0.0
true
8.1.0
@@ -10,6 +10,7 @@
+
@@ -20,6 +21,7 @@
+
@@ -41,12 +43,4 @@
-
-
-
-
-
-
-
-
diff --git a/bench/Polly.Benchmarks/Polly.Benchmarks.csproj b/bench/Polly.Benchmarks/Polly.Benchmarks.csproj
index 53a3e563d6a..0fc02332e3f 100644
--- a/bench/Polly.Benchmarks/Polly.Benchmarks.csproj
+++ b/bench/Polly.Benchmarks/Polly.Benchmarks.csproj
@@ -2,7 +2,7 @@
false
Exe
- net6.0;net7.0
+ net6.0;net7.0;net8.0
enable
Benchmark
$(NoWarn);CA1822;SA1414;IDE0060
diff --git a/bench/Polly.Core.Benchmarks/Polly.Core.Benchmarks.csproj b/bench/Polly.Core.Benchmarks/Polly.Core.Benchmarks.csproj
index d7742e9db96..fd0ec851ece 100644
--- a/bench/Polly.Core.Benchmarks/Polly.Core.Benchmarks.csproj
+++ b/bench/Polly.Core.Benchmarks/Polly.Core.Benchmarks.csproj
@@ -1,6 +1,6 @@
- net7.0
+ net8.0;net7.0
Polly
true
Benchmark
diff --git a/build.cake b/build.cake
index 013c4260812..e535c0ba225 100644
--- a/build.cake
+++ b/build.cake
@@ -33,7 +33,7 @@ var artifactsDir = Directory("./artifacts");
var testResultsDir = System.IO.Path.Combine(artifactsDir, Directory("test-results"));
// NuGet
-var nupkgDestDir = System.IO.Path.Combine(artifactsDir, Directory("nuget-packages"));
+var nupkgDestDir = System.IO.Path.Combine(artifactsDir, Directory("package"), Directory("release"));
// Stryker / Mutation Testing
var strykerConfig = MakeAbsolute(File("./eng/stryker-config.json"));
@@ -65,17 +65,13 @@ Teardown(_ =>
Task("__Clean")
.Does(() =>
{
- DirectoryPath[] cleanDirectories = new DirectoryPath[]
+ CleanDirectories(new[]
{
testResultsDir,
nupkgDestDir,
artifactsDir,
strykerOutput
- };
-
- CleanDirectories(cleanDirectories);
-
- foreach (var path in cleanDirectories) { EnsureDirectoryExists(path); }
+ });
foreach (var path in solutionPaths)
{
diff --git a/eng/Library.targets b/eng/Library.targets
index 64004df8f31..b09e5c2a93a 100644
--- a/eng/Library.targets
+++ b/eng/Library.targets
@@ -14,6 +14,7 @@
true
+
8.1.0
diff --git a/eng/stryker-config.json b/eng/stryker-config.json
index ba638442829..bba70bf11b9 100644
--- a/eng/stryker-config.json
+++ b/eng/stryker-config.json
@@ -18,7 +18,8 @@
"block",
"statement"
],
- "target-framework": "net7.0",
+ "language-version": "Preview",
+ "target-framework": "net8.0",
"thresholds": {
"high": 100,
"low": 100
diff --git a/global.json b/global.json
index 0115ef0494c..33d26e563fb 100644
--- a/global.json
+++ b/global.json
@@ -1,6 +1,6 @@
{
"sdk": {
- "version": "7.0.403",
+ "version": "8.0.100",
"allowPrerelease": false,
"rollForward": "latestMajor"
}
diff --git a/src/Polly.Core/CircuitBreaker/CircuitBreakerManualControl.cs b/src/Polly.Core/CircuitBreaker/CircuitBreakerManualControl.cs
index bb4adb10a3f..1258c4f5ae4 100644
--- a/src/Polly.Core/CircuitBreaker/CircuitBreakerManualControl.cs
+++ b/src/Polly.Core/CircuitBreaker/CircuitBreakerManualControl.cs
@@ -9,8 +9,8 @@ namespace Polly.CircuitBreaker;
public sealed class CircuitBreakerManualControl
{
private readonly object _lock = new();
- private readonly HashSet> _onIsolate = new();
- private readonly HashSet> _onReset = new();
+ private readonly HashSet> _onIsolate = [];
+ private readonly HashSet> _onReset = [];
private bool _isolated;
///
diff --git a/src/Polly.Core/CircuitBreaker/Controller/CircuitStateController.cs b/src/Polly.Core/CircuitBreaker/Controller/CircuitStateController.cs
index 8e71fb79c7a..73fc1010629 100644
--- a/src/Polly.Core/CircuitBreaker/Controller/CircuitStateController.cs
+++ b/src/Polly.Core/CircuitBreaker/Controller/CircuitStateController.cs
@@ -254,10 +254,14 @@ private static bool IsDateTimeOverflow(DateTimeOffset utcNow, TimeSpan breakDura
private void EnsureNotDisposed()
{
+#if NET8_0_OR_GREATER
+ ObjectDisposedException.ThrowIf(_disposed, this);
+#else
if (_disposed)
{
throw new ObjectDisposedException(nameof(CircuitStateController));
}
+#endif
}
private void CloseCircuit_NeedsLock(Outcome outcome, bool manual, ResilienceContext context, out Task? scheduledTask)
diff --git a/src/Polly.Core/CircuitBreaker/Controller/ScheduledTaskExecutor.cs b/src/Polly.Core/CircuitBreaker/Controller/ScheduledTaskExecutor.cs
index b3b7cc530ef..7bc3f6f6d5f 100644
--- a/src/Polly.Core/CircuitBreaker/Controller/ScheduledTaskExecutor.cs
+++ b/src/Polly.Core/CircuitBreaker/Controller/ScheduledTaskExecutor.cs
@@ -17,10 +17,14 @@ internal sealed class ScheduledTaskExecutor : IDisposable
public void ScheduleTask(Func taskFactory, ResilienceContext context, out Task task)
{
+#if NET8_0_OR_GREATER
+ ObjectDisposedException.ThrowIf(_disposed, this);
+#else
if (_disposed)
{
throw new ObjectDisposedException(nameof(ScheduledTaskExecutor));
}
+#endif
var source = new TaskCompletionSource