C#8.0是否支持IAsyncEnumerable?

问题描述 投票:3回答:2

除了“What's New c#8.0”文章中的一些提及之外,很难找到关于IAsyncEnumerable的任何信息。尝试在启用netstandard 2.0和C#8的Visual Studio 2019中使用它,它确实识别了类,但我在构建时遇到了大量错误:

enter image description here

c# .net-standard-2.0
2个回答
6
投票

C#8支持这些功能。但是,这不适用于.Net标准2.0

IAsyncEnumerable Interface

适用于

.NET Core 3.0预览版3

.NET Standard 2.1预览版

您必须获得其中一个预览。

您可以在此处找到有关.Net Core 3 Preview的更多信息


0
投票

看起来您需要以.NET Standard 2.1为目标,但它仍然只在预览中。

https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.iasyncenumerable-1?view=netstandard-2.1

© www.soinside.com 2019 - 2024. All rights reserved.