Is IAsyncEnumerable supported in C# 8.0?

核能气质少年 提交于 2019-12-07 11:43:20

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!