C# .NET – Generate error message when “async void” is used in code

The mentioned AsyncFixer extension and Nuget Package are super useful when dealing with async code. They both package a Roslyn analyzer that detects many async issues and provides an automatic fix for them as well in most cases. Using the .editorconfig in Visual Studio you can configure specific warnings as errors:
[*.cs] # AsyncFixer03: Fire-and-forget async-void methods or delegates dotnet_diagnostic.AsyncFixer03.severity = error
And you can set that straight from the Solution Explorer in case you’ve a

Source: c# – Generate error message when “async void” is used in code – Stack Overflow

Leave a Reply

Your email address will not be published. Required fields are marked *