TaskTupleAwaiter 2.3.0

dotnet add package TaskTupleAwaiter --version 2.3.0
                    
NuGet\Install-Package TaskTupleAwaiter -Version 2.3.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="TaskTupleAwaiter" Version="2.3.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="TaskTupleAwaiter" Version="2.3.0" />
                    
Directory.Packages.props
<PackageReference Include="TaskTupleAwaiter" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add TaskTupleAwaiter --version 2.3.0
                    
#r "nuget: TaskTupleAwaiter, 2.3.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package TaskTupleAwaiter@2.3.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=TaskTupleAwaiter&version=2.3.0
                    
Install as a Cake Addin
#tool nuget:?package=TaskTupleAwaiter&version=2.3.0
                    
Install as a Cake Tool

TaskTupleAwaiter

Continuous Integration NuGet NuGet Downloads License: MIT

Await multiple tasks with different return types — elegantly.

TaskTupleAwaiter lets you await a tuple of tasks and destructure the results in a single line. No more juggling Task.WhenAll, casting from object, or writing verbose boilerplate to run independent async operations in parallel.

Before & After

// ❌ Without TaskTupleAwaiter
var userTask = GetUserAsync(id);
var ordersTask = GetOrdersAsync(id);
await Task.WhenAll(userTask, ordersTask);
var user = userTask.Result;
var orders = ordersTask.Result;

// ✅ With TaskTupleAwaiter
var (user, orders) = await (GetUserAsync(id), GetOrdersAsync(id));

Features

  • Tuple-based await — fire multiple async calls in parallel and destructure results with a single await
  • Supports up to 16 tasks — mix and match any combination of return types
  • ConfigureAwait support — works with ConfigureAwait(false) and .NET 8+ ConfigureAwaitOptions
  • Non-generic Task support — await tuples of Task (not just Task<T>) when you don't need return values
  • Zero dependencies — a single file, no external packages (except System.ValueTuple on .NET Framework 4.6.2)
  • Broad compatibility — supports .NET Standard 2.0+, .NET Framework 4.6.2+, and .NET 8+
  • NativeAOT ready — the package sets <IsAotCompatible>true</IsAotCompatible> for .NET 8+ targets, and CI publishes downstream NativeAOT smoke tests

Installation

dotnet add package TaskTupleAwaiter

Or via the NuGet Package Manager:

Install-Package TaskTupleAwaiter

Usage

Basic — two tasks with different return types

var (name, age) = await (GetNameAsync(), GetAgeAsync());

ConfigureAwait(false)

var (policy, preferences) = await (
    GetPolicyAsync(policyId, cancellationToken),
    GetPreferencesAsync(cancellationToken)
).ConfigureAwait(false);

ConfigureAwaitOptions (.NET 8+)

var (user, settings) = await (
    GetUserAsync(userId),
    GetSettingsAsync()
).ConfigureAwait(ConfigureAwaitOptions.None);

Many tasks at once (up to 16)

var (a, b, c, d, e) = await (
    GetAAsync(),
    GetBAsync(),
    GetCAsync(),
    GetDAsync(),
    GetEAsync()
);

Non-generic tasks (fire-and-await)

await (SendEmailAsync(), LogAuditAsync(), InvalidateCacheAsync());

How It Works

TaskTupleAwaiter provides extension methods on ValueTuple<Task<T1>, ..., Task<TN>> (and ValueTuple<Task, ..., Task>) that implement the awaitable pattern. Under the hood each awaiter calls Task.WhenAll to run the tasks concurrently, then unwraps the individual results into a tuple — giving you the performance of parallel execution with the ergonomics of simple destructuring.

Compatibility

Target Version
.NET Standard 2.0
.NET Framework 4.6.2+
.NET 8.0+

Credits

Based on the original work by Joseph Musser (@jnm2)original gist.

License

MIT © Brian Buvinghausen

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 is compatible.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETFramework 4.6.2

  • .NETStandard 2.0

    • No dependencies.
  • net8.0

    • No dependencies.
  • net9.0

    • No dependencies.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on TaskTupleAwaiter:

Package Downloads
Shinya.Core

Shinya.Framework

TheLair.Extensions

Package Description

Taf.Core.Extension

Package Description

GitHub repositories (4)

Showing the top 4 popular GitHub repositories that depend on TaskTupleAwaiter:

Repository Stars
ChangemakerStudios/Papercut-SMTP
Papercut SMTP -- The Simple Desktop Email Server
microsoft/onefuzz
A self-hosted Fuzzing-As-A-Service platform
itlibrium/DDD-starter-dotnet
Sample implementation and comparison of various approaches to building DDD applications. Useful as a baseline to quickly start a DDD dot net project.
lindexi/lindexi_gd
博客用到的代码
Version Downloads Last Updated
2.3.0 1,658 5/15/2026
2.2.0 528 5/13/2026
2.1.3 37,736 3/7/2026
2.1.2 51,081 1/6/2026
2.1.1 82,108 8/14/2025
2.1.0 845,160 3/20/2024
2.0.3 231,124 2/27/2023
2.0.2 112,823 10/25/2022
2.0.1 5,987 10/5/2022
2.0.0 125,572 9/15/2021
1.2.3 93,284 11/11/2020
1.2.2 287,530 7/31/2020
1.2.1 29,338 7/8/2020
1.2.0 147,235 7/31/2018
1.1.2 5,577 1/15/2018
1.1.1 2,312 1/5/2018
1.1.0 1,682 12/13/2017
1.0.1 1,878 10/17/2017
1.0.0 4,320 9/25/2017