Threading.Analyzer 1.0.0

dotnet add package Threading.Analyzer --version 1.0.0
                    
NuGet\Install-Package Threading.Analyzer -Version 1.0.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="Threading.Analyzer" Version="1.0.0">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Threading.Analyzer" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Threading.Analyzer">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
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 Threading.Analyzer --version 1.0.0
                    
#r "nuget: Threading.Analyzer, 1.0.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 Threading.Analyzer@1.0.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=Threading.Analyzer&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Threading.Analyzer&version=1.0.0
                    
Install as a Cake Tool

Threading Analyzer for C#

Analyzer that finds dependency free asynchronous tasks and give a warning that they should be run in parallel instead, using Task.WhenAll or using Federico Alterio's Task extensions for allowing you to await a tuple of tasks directly. https://www.codeproject.com/articles/Awaiting-a-Tuple-of-Tasks-in-Csharp

Why?

Awaiting tasks in a waterfall manner that could be run in parallel degrades the performance of your application since you could be running all tasks at the same time and minimize the response time of the application.

A minimal example is:

public async Task<UserInfo> GetUserInfo(Guid userId) {
    var dbUser = await _db.GetUserById(userId);
    var externalUserInfo = await _userApi.GetUserById(userId);
}

Here we won't even start to try to get the user info from the external api until we have gotten the user info from the database. There is no dependency between the tasks and so they should be run in parallel to minimize the response times.

public async Task<UserInfo> GetUserInfo(Guid userId) {
    var (dbUser, externalUserInfo) = await (
        _db.GetUserById(userId),
        _userApi.GetUserById(userId)
    );
}

Now we're running both tasks at the same time, in parallel.

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 175 12/5/2025