warning this call is not awaited, execution of the current method continues
See the question and my original answer on StackOverflowIf you don't want to change the method signature to return void
(as returning void
should always be avoided), you can use C# 7.0+ Discard feature like this, which is slightly better than assigning to a variable (and should remove most other source validation tools warnings):
public static void DoStuff()
{
_ = GetNameAsync(); // we don't need the return value (suppresses warning)
MainWorkOfApplicationIDontWantBlocked();
}