Reputation: 28818
Other than writing my own Roslyn based code analysis tool to find such code, is there a simple way to find calls to methods that return a Task
object, but that are not awaited?
Upvotes: 0
Views: 67
Reputation: 456507
There is already a compiler warning for this, unless you turn it off or write code explicitly to suppress the warning (such as assigning the returned task to a variable).
Personally, I prefer to have compiler warnings as errors.
Upvotes: 4