What's the best approach to "CS4014: Because this call is not awaited, execution of the current method continues before the call is completed"?

Viewed 37

enter image description here

Visual Studio is showing this warning on every async task that I do not want to await. Why? I don't want to globally suppress all these warnings, because there may be instances I forget to await, but most of the time when this warning appears, it's because I'm intentionally not awaiting a task. What's the best response to these warnings?

1 Answers

The problem is that it is returning a task, so to not await, the best way is to just set the return to something such as:

_ = SomeAwaitableTask();
Related