Skip to content

Commit adde5f0

Browse files
authored
build!: require .NET 8 or later (#350)
Drop net6.0 and netstandard2.0 compatibility shims and packages now that v4 targets supported .NET releases. BREAKING CHANGE: v4 no longer supports net6.0 or netstandard2.0. Consumers must target net8.0 or later. Refs #334
1 parent e7cae8d commit adde5f0

12 files changed

Lines changed: 7 additions & 86 deletions

File tree

EnumerableAsyncProcessor.Example/DisposalExample.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#if NET6_0_OR_GREATER
21
using System;
32
using System.Collections.Generic;
43
using System.Runtime.CompilerServices;
@@ -169,4 +168,3 @@ private static async IAsyncEnumerable<int> GenerateAsyncEnumerable(
169168
}
170169
}
171170
}
172-
#endif

EnumerableAsyncProcessor.Example/ProcessInParallelExample.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#if NET6_0_OR_GREATER
21
using System;
32
using System.Collections.Generic;
43
using System.Linq;
@@ -111,4 +110,3 @@ private static async IAsyncEnumerable<int> GenerateAsyncEnumerable(
111110
}
112111
}
113112
}
114-
#endif

EnumerableAsyncProcessor.Example/Program.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ Task<HttpResponseMessage> PingAsync()
6666
}
6767
}
6868

69-
#if NET6_0_OR_GREATER
7069
// Run IAsyncEnumerable examples
7170
Console.WriteLine("\n\n=== Running IAsyncEnumerable Examples ===\n");
7271
await AsyncEnumerableExample.RunExamples();
@@ -78,4 +77,3 @@ Task<HttpResponseMessage> PingAsync()
7877
// Run disposal pattern examples
7978
Console.WriteLine("\n\n=== Running Disposal Pattern Examples ===\n");
8079
await DisposalExample.RunExamples();
81-
#endif

EnumerableAsyncProcessor.UnitTests/AsyncEnumerableParallelExtensionsTests.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#if NET6_0_OR_GREATER
21
using System;
32
using System.Collections.Generic;
43
using System.Diagnostics;
@@ -219,4 +218,3 @@ public async Task ProcessInParallel_PreservesExceptionFromTransformation()
219218
await Assert.That(exception.Message).IsEqualTo("Test exception");
220219
}
221220
}
222-
#endif

EnumerableAsyncProcessor.UnitTests/AsyncEnumerableProcessorTests.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#if NET6_0_OR_GREATER
21
using System;
32
using System.Collections.Generic;
43
using System.Linq;
@@ -142,7 +141,6 @@ public async Task SelectAsync_ProcessInParallel_WithHighConcurrency_HandlesCorre
142141
await Assert.That(results.OrderBy(x => x)).IsEquivalentTo(Enumerable.Range(1, 50).Select(x => x * 3));
143142
}
144143

145-
146144
[Test]
147145
public async Task ForEachAsync_WithCancellation_StopsProcessing()
148146
{
@@ -368,4 +366,3 @@ public static async Task<List<T>> ToListAsync<T>(this IAsyncEnumerable<T> source
368366
return list;
369367
}
370368
}
371-
#endif

EnumerableAsyncProcessor.UnitTests/EnumerableAsyncProcessor.UnitTests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<!-- net8.0 also exercises the pre-net9 completion-order streaming path in ToIAsyncEnumerable -->
5-
<TargetFrameworks>net9.0;net8.0</TargetFrameworks>
5+
<TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks>
66
<Nullable>enable</Nullable>
77
<IsPackable>false</IsPackable>
88
<!-- Do not warn about non-strong named dependencies, as we target .NET (not .NET Framework).

EnumerableAsyncProcessor/EnumerableAsyncProcessor.csproj

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net6.0;net8.0;net9.0;netstandard2.0</TargetFrameworks>
4+
<TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
77
<LangVersion>latest</LangVersion>
@@ -21,10 +21,6 @@
2121
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
2222
</PropertyGroup>
2323

24-
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
25-
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="6.0.0" />
26-
</ItemGroup>
27-
2824
<ItemGroup>
2925
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo">
3026
<_Parameter1>$(MSBuildProjectName).UnitTests, PublicKey=$(PublicKey)</_Parameter1>
@@ -34,11 +30,6 @@
3430

3531
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="10.0.301" PrivateAssets="All"/>
3632

37-
<PackageReference Include="Polyfill" Version="11.0.1">
38-
<PrivateAssets>all</PrivateAssets>
39-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
40-
</PackageReference>
41-
4233
</ItemGroup>
4334

4435
<PropertyGroup>

EnumerableAsyncProcessor/RunnableProcessors/Abstract/AbstractAsyncProcessorBase.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,7 @@ public async ValueTask DisposeAsync()
7171

7272
protected virtual ValueTask DisposeAsyncCore()
7373
{
74-
#if NET6_0_OR_GREATER
7574
return ValueTask.CompletedTask;
76-
#else
77-
return new ValueTask(Task.CompletedTask);
78-
#endif
7975
}
8076

8177
public void Dispose()

EnumerableAsyncProcessor/RunnableProcessors/ResultProcessors/Abstract/ResultAbstractAsyncProcessorBase.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,7 @@ public async ValueTask DisposeAsync()
7777

7878
protected virtual ValueTask DisposeAsyncCore()
7979
{
80-
#if NET6_0_OR_GREATER
8180
return ValueTask.CompletedTask;
82-
#else
83-
return new ValueTask(Task.CompletedTask);
84-
#endif
8581
}
8682

8783
public void Dispose()

EnumerableAsyncProcessor/TaskCompletionSource.cs

Lines changed: 0 additions & 34 deletions
This file was deleted.

0 commit comments

Comments
 (0)