Microsoft.Bcl.AsyncInterfaces (8.0.0)

Published 2026-09-09 02:37:56 +03:30 by kayer

Installation

dotnet nuget add source --name kayer --username your_username --password your_token 
dotnet add package --source kayer --version 8.0.0 Microsoft.Bcl.AsyncInterfaces

About this package

Provides the IAsyncEnumerable and IAsyncDisposable interfaces and helper types for .NET Standard 2.0. This package is not required starting with .NET Standard 2.1 and .NET Core 3.0.

Commonly Used Types: System.IAsyncDisposable System.Collections.Generic.IAsyncEnumerable System.Collections.Generic.IAsyncEnumerator

About

As of C# 8, the C# language has support for producing and consuming asynchronous iterators. The library types in support of those features are available in .NET Core 3.0 and newer as well as in .NET Standard 2.1. This library provides the necessary definitions of those types to support these language features on .NET Framework and on .NET Standard 2.0. This library is not necessary nor recommended when targeting versions of .NET that include the relevant support.

Key Features

  • Enables the use of C# async iterators on older .NET platforms

How to Use

using System;
using System.Collections.Generic;
using System.Threading.Tasks;

internal static class Program
{
    private static async Task Main()
    {
        Console.WriteLine("Starting...");
        await foreach (var value in GetValuesAsync())
        {
            Console.WriteLine(value);
        }
        Console.WriteLine("Finished!");

        static async IAsyncEnumerable<int> GetValuesAsync()
        {
            for (int i = 0; i < 10; i++)
            {
                await Task.Delay(TimeSpan.FromSeconds(1));
                yield return i;
            }
        }
    }
}

Main Types

The main types provided by this library are:

  • IAsyncEnumerable<T>
  • IAsyncEnumerator<T>
  • IAsyncDisposable<T>

Additional Documentation

Feedback & Contributing

Microsoft.Bcl.AsyncInterfaces is released as open source under the MIT license. Bug reports and contributions are welcome at the GitHub repository.

Dependencies

ID Version Target Framework
System.Threading.Tasks.Extensions 4.5.4 .NETFramework4.6.2
System.Threading.Tasks.Extensions 4.5.4 .NETStandard2.0
Details
NuGet
2026-09-09 02:37:56 +03:30
8
Microsoft
99 KiB
Assets (2)
Versions (4) View all
8.0.0 2026-09-09
7.0.0 2026-02-04
6.0.0 2026-02-04
1.1.1 2026-02-04