dotnet / dotnet/roslyn

"Make Method Async" is not update interface correctly.

Open
#75,626 0 comments 0 reactions 1 assignee Claimed by @genlu View on GitHub
Area-IDE
Dominant language
C#
Stars
20.7k
Forks
4.3k
PR merge metrics
PR metrics pending

Description

**Version Used**: Visual Studio 2022 - Version 17.11.4

**Steps to Reproduce**:

1. Create and Interface and a Class that implements that interface, the interface has one sync method for example, int Log(LogEntity log);
2. Inside implemented class, add an await to method call that is return Task
3. Roslyn will suggest you to make method async. click on it and move forward.
4. The method signature in implementation is as public async Task LogAsync(LogEntity log) but in Interface the method signature changed to int LogAsync(LogEntity log);

now you have an error that you are not implementing interface because the method signatures does not match in both interface and implementation.

**Actual Behavior**:
![Image](https://github.com/user-attachments/assets/27187674-bb45-42b6-a42e-01a9670286e0)

**Expected Behavior**:
Should add Task< > to the signature in interface.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.