AsyncFixer
AsyncFixer copied to clipboard
Advanced async/await Diagnostics and CodeFixes for C#
``` public async Task Run() { Console.WriteLine(DateTime.Now); await SomeDelay(); Console.WriteLine(DateTime.Now); } // Warns as expected private async Task SomeDelay() { await Task.Factory.StartNew(async () => { await Task.Delay(10000); }); } //...
``` Task foo() { using var destination = new MemoryStream(); using FileStream source = File.Open("data", FileMode.Open); return source.CopyToAsync(destination); } ``` should warn that streams could be closed before task executed
This will not compile: ``` delegate void Foo(); void Call(Foo f) { f(); } void TestCall() { Call(() => { return true; } ); // CS8030 Anonymous function converted to...
Thanks for the analyzer! 🙂 We've been using the analyzer in several of our projects for a while now. We always disable the AsyncFixer01: "Unnecessary async/await usage" warning, because the...
Thank you for this great extension! I have realized that I often miss the presence of IAsyncDisposable interfaces and there is no warning that indicates this. Example: ```csharp static async...
Take a look at a SO question I have asked: https://stackoverflow.com/questions/65891357/is-there-a-way-to-warn-about-an-unawaited-tasks Someone suggested this package, however it does not cover such case. Is this something that can potentially be added...
I'm using a CancellationTokenSource for two asynchronous actions, then awaiting them using Task.WhenAny But this is triggering AsyncFixer (Code AsyncFixer04) in a way that I don't understand. If I set...
We have several occurrences of the following pattern: ```c# Task[] tasks = CreateTasks(); await Task.WhenAll(tasks); foreach(var task in tasks) Console.WriteLine(task.Result); ``` The above code will generate an AsyncFixer02 warning for...
would be useful to provide this as dotnet tool just to run in CI/CD pipelines, instead of having a nugget dependency...
Nuget points to asyncfix.com as the project site but it doesn't work.