/AsyncRefactoringBug

Repro project for an annoying bug in VS 2019's "Make method async" refactoring

Primary LanguageC#MIT LicenseMIT

VS 2019 Async Refactoring Bug

Repro project for an annoying bug in VS 2019's "Make method async" refactoring. When applying the "Make method async" refactoring, Visual Studio appends an Async suffix to the method. This is a little opinionated, but fair enough.

The problem is that it is doing it to methods that implement interfaces from NuGet packages. 💥 It can't change the interface itself, because it doesn't have access to the source, but it does change every other implementation of the interface. ☠☠☠

Steps to reproduce

  1. Check out the master branch and open the solution in VS 2019.
  2. Add an await keyword before the call to GetGreeting() in GreetingRequest.cs.
  3. Apply the "Make method async" refactoring when VS suggests it
  4. Both GreetingRequest.cs and SomeOtherRequest.cs will now be broken. 😞 (Their Handle methods have been renamed to HandleAsync, which no longer implements the MediatR IRequestHandler interface correctly.)

Alternatively, check out the after-refactoring branch and take a look.