You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/core/compatibility/core-libraries/10.0/asyncenumerable.md
+22-8Lines changed: 22 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,23 +24,37 @@ The <xref:System.Linq.AsyncEnumerable> class in .NET 10, and in the [`System.Lin
24
24
25
25
## Type of breaking change
26
26
27
-
This is a [source incompatible](../../categories.md#source-compatibility) change.
27
+
This change can affect [source compatibility](../../categories.md#source-compatibility).
28
28
29
29
## Reason for change
30
30
31
31
<xref:System.Collections.Generic.IAsyncEnumerable`1> is a commonly used interface, so the platform itself should provide LINQ support for the type. Maintainers of `System.Linq.Async` and other community members petitioned for inclusion directly in the platform.
32
32
33
33
## Recommended action
34
34
35
-
If upgrading to .NET 10 and the code includes a direct package reference to `System.Linq.Async`, remove that package reference. For multitargeting both .NET 10 and previous versions, add a package reference to `System.Linq.AsyncEnumerable` instead.
35
+
If you're upgrading to .NET 10 and your code includes a direct package reference to `System.Linq.Async`, remove that package reference. For multitargeting both .NET 10 and a previous version, add a package reference to `System.Linq.AsyncEnumerable` instead.
36
36
37
-
If `System.Linq.Async` is consumed indirectly via another package, avoid ambiguity errors by including this in the project:
37
+
If `System.Linq.Async` is consumed indirectly via another package, avoid ambiguity errors by adding `<ExcludeAssets>` metadata with a value of `compile` or `all`:
Use this configuration only if you're certain no dependencies require System.Linq.Async at run time.
44
58
45
59
Most consuming code should be compatible without changes, but some call sites might need updates to refer to newer names and signatures. For example, a `Select` call like `e.Select(i => i * 2)` will work the same before and after. However, the call `e.SelectAwait(async (int i, CancellationToken ct) => i * 2)` will need to be changed to use `Select` instead of `SelectAwait`, as in `e.Select(async (int i, CancellationToken ct) => i * 2)`.
0 commit comments