The auto-completion for await changes the method's signature - how do I prevent that?

2 days ago 2
ARTICLE AD BOX

This is a bug that has been presumably fixed in late 2025. Although it looks like the fix will only apply to event handlers and not all void methods.

Looks like it was included in VS too. Not sure which release of VS 2022 has the changes - can't be < 17.14.22. Latest is 17.14.25, so updating to it might fix your issue (haven't tested myself).

If you are using VS 2022 Pro/Enterprise, you can temporarily try to downgrade to 17.12.* (LTSC channel) suppored until July 2026. As mentioned in a comment I couldn't reproduce the bug in 17.12.3 - hopefully it didn't make its way in later patch versions.

Ivan Petrov's user avatar

4 Comments

I just updated to version 17.14.25, created a new WPF application, changed target version to the latest SDK (10.0.26100.0) just to be sure, created a void method, and the bug is still there.

2026-01-25T14:13:42.263Z+00:00

The amount of back and forth in the dotnet/roslyn repository about this functionality is insane.

2026-01-25T14:31:38.783Z+00:00

@ispiro maybe they've only included the bugfix in 18 (VS 2026), and not 17. Not sure what their support policy is. Maybe them identifying this as a "feature" and not officially a bug in github is somehow related.

2026-01-25T15:52:07.07Z+00:00

@null bonus points - it looks like Copilot implemented this.

2026-01-25T15:53:13.107Z+00:00

I found a temporary solution that can perfectly meet your needs. Just import an 'await' snippet and then it will only insert 'await' without changing any code. I use 'awa' as shortcut here to retain the original functionality.

<?xml version="1.0" encoding="utf-8" ?> <CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"> <CodeSnippet Format="1.0.0"> <Header> <Title>await</Title> <Shortcut>awa</Shortcut> <Description>Code snippet for 'await' keyword</Description> <Author>Shingo</Author> <SnippetTypes> <SnippetType>Expansion</SnippetType> </SnippetTypes> </Header> <Snippet> <Code Language="csharp"><![CDATA[await $end$]]> </Code> </Snippet> </CodeSnippet> </CodeSnippets>

shingo's user avatar

I cannot reproduce the problem.

before tab

enter image description here

afer tab

enter image description here

I'm running

Microsoft Visual Studio Professional 2022 Version 17.11.5 C# Tools 4.11.0-3.24460.3+5649376e0e5f5db3743a94a62b073f2cce4be5d9 C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used. Visual Studio IntelliCode 2.2 AI-assisted development for Visual Studio.

In a response to a related issue async/await Visual Studio autocomplete #68512 on github the functionality is mentioned:

We also just add 'async' automatically to the method if you try to complete out await in your method body.

It does not mention any modification of the return type (or lack thereof). Note that the opener of the issue explicitly asks for a modification of the return type to Task, which is the undesired behavior that you observe. However the issue is "closed as not planned".

In this PR, the functionality was implemented including the modification of the return type.

null's user avatar

4 Comments

I'm running Version 17.14.20, you're running 17.11.5. I'm assuming it's something new.

2026-01-25T11:44:28.69Z+00:00

The closed as not planned is from 2.5 years ago. I guess they changed their mind since then.

2026-01-25T11:46:59.59Z+00:00

I found the PR that changed it and updated my answer.

2026-01-25T12:42:04.713Z+00:00

I also reproduce the issue with version 17.14.22.

2026-01-25T11:49:29.08Z+00:00

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.

Read Entire Article