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?
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();
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.