问题
Its really hard to find any information on IAsyncEnumerable
, other than a few mentions in the 'What's New c# 8.0' articles. Trying to use it in Visual Studio 2019 with netstandard 2.0 and C# 8 enabled, it does recognize the class but i get a ton of errors on build:
回答1:
C# 8 supports these features. However, this wont work with .Net standard 2.0
IAsyncEnumerable Interface
Applies to
.NET Core 3.0 Preview 3
.NET Standard 2.1 Preview
You will have to get either one of the previews.
You can find more information on .Net Core 3 Preview here
https://devblogs.microsoft.com/dotnet/announcing-net-core-3-preview-4/
https://dotnet.microsoft.com/download/dotnet-core/3.0
回答2:
Looks like you need to target .NET Standard 2.1 but it’s still only in preview.
https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.iasyncenumerable-1?view=netstandard-2.1
来源:https://stackoverflow.com/questions/55821746/is-iasyncenumerable-supported-in-c-sharp-8-0