AsyncFixer 1.0.0

There is a newer version of this package available.
See the version list below for details.
The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet add package AsyncFixer --version 1.0.0
NuGet\Install-Package AsyncFixer -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="AsyncFixer" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add AsyncFixer --version 1.0.0
#r "nuget: AsyncFixer, 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.
// Install AsyncFixer as a Cake Addin
#addin nuget:?package=AsyncFixer&version=1.0.0

// Install AsyncFixer as a Cake Tool
#tool nuget:?package=AsyncFixer&version=1.0.0

AsyncFixer helps developers in finding and correcting 3 common async/await misuses (anti-patterns). AsyncFixer was tested with hundreds of C# apps and successfully handles many corner cases.



AsyncFixer (the nuget package) will work as a project-local analyzer that participates in builds. Attaching an analyzer to a project means that the analyzer travels with the project to source control and so it's easy to apply the same rule for the team. It also means that commandline builds report the issues reported by the analyzer.



If you want AsyncFixer to work just in the IDE and to work as an analyzer on every project you open in Visual Studio, please download the VSIX extension instead of this nuget package from here: https://visualstudiogallery.msdn.microsoft.com/03448836-db42-46b3-a5c7-5fc5d36a8308



Here are 3 misuses that AsyncFixer detects:



1) Unnecessary async/await Methods



There are some async methods where there is no need to use async/await. It is important to detect this kind of misuse because adding the async modifier comes at a price.



AsyncFixer removes async/await keywords from these methods.





2) Using Long-running Operations under Async Methods



Developers use some potentially long running or blocking operations under async methods even though there are corresponding asynchronous versions of these methods in .NET or third-party libraries. Some example for such operations: Task.Wait(), Task.Result, Task.WaitAll(...), StreamReader.ReadToEnd(...), Thread.Sleep(...), etc.



AsyncFixer automatically replaces these operations with their corresponding asynchronous operations and inserts 'await' expression. For instance, it converts Thread.Sleep(...) to await Task.Delay(...).





3) Fire & Forget Methods



Some async methods are 'fire&forget', which return void. Unless a method is only called as an event handler, it must be awaitable. Otherwise, it is a code smell because it complicates control flow and makes error detection & correction difficult.



AsyncFixer replaces the return type of the (non-event handler) method with 'Task'.



4) Decide the use of ConfigureAwait(false)



AsyncFixer checks whether the method and its call graph will ever need the UI or Request (ASP.NET) context at all. AsyncFixer decides the need for ConfigureAwait(false) in the await statement(s) in the method body.



It's coming soon!



*** Important ***



The detection and fixing of more async/await misuses are being implemented.

Please send your bug report or feedback to semih.okur@gmail.com

Learn more information about these misuses from our website: LearnAsync.NET

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages (5)

Showing the top 5 NuGet packages that depend on AsyncFixer:

Package Downloads
Lombiq.Analyzers The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

Lombiq .NET Analyzers: .NET code analyzers and code convention settings for general .NET projects. See the project website for detailed documentation.

Brupper.Forms

This package contains Brupper to use with Xamarin.Forms

Brupper.Forms.FontAwesome

This package contains Brupper to use with Xamarin.Forms

Brupper.Push

This package contains Brupper to use with Xamarin project for handling push notificcations.

n2.core

Core functionality for any application

GitHub repositories (31)

Showing the top 5 popular GitHub repositories that depend on AsyncFixer:

Repository Stars
MvvmCross/MvvmCross
The .NET MVVM framework for cross-platform solutions, including Android, iOS, MacCatalyst, macOS, tvOS, WPF, WinUI
exceptionless/Exceptionless
Exceptionless application
FoundatioFx/Foundatio
Pluggable foundation blocks for building distributed apps.
ArduPilot/MissionPlanner
Mission Planner Ground Control Station for ArduPilot (c# .net)
Baseflow/LottieXamarin
Render After Effects animations natively on Android, iOS, MacOS and TvOS for Xamarin
Version Downloads Last updated
1.6.0 3,535,063 5/10/2022
1.5.1 3,203,965 1/22/2021
1.3.0 486,632 5/27/2020

Updated for Visual Studio 2015 RTM.