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. ☠☠☠
- Check out the master branch and open the solution in VS 2019.
- Add an
await
keyword before the call toGetGreeting()
in GreetingRequest.cs. - Apply the "Make method async" refactoring when VS suggests it
- Both GreetingRequest.cs and SomeOtherRequest.cs will now be broken. 😞 (Their
Handle
methods have been renamed toHandleAsync
, which no longer implements the MediatRIRequestHandler
interface correctly.)
Alternatively, check out the after-refactoring
branch and take a look.