Misleading error for await in the watch window #46795
Labels
Area-Interactive
Bug
help wanted
The issue is "up for grabs" - add a comment if you are interested in working on it
Milestone
Version Used: VS 16.7.1
Steps to Reproduce:
Attempt to use the
await
operator (e.g.await Task.Delay(0)
) in the watch window while debugging a method.Expected Behavior:
An error message explaining that the debugger doesn't support
await
, possibly suggesting to use.Result
/.Wait()
instead. Or even better,await
works in the debugger.Actual Behavior:
In the case of an async method, the error shown in the watch window is:
For a non-async method, the error is almost the same:
In both cases, the error is misleading: For the async method, it's already async and returns a Task, so the suggestion doesn't make sense. For the non-async method, adding
async
wouldn't fix the issue, so it's also wrong.The text was updated successfully, but these errors were encountered: