C# How to start an async method without await its complete?

If you truly just want to fire and forget. Simply don't call use await.

// It is a good idea to add CancellationTokens
var asyncProcedure = SomeHTTPAction(cancellationToken).ConfigureAwait(false);

// Or If not simply do:
var asyncProcedure = SomeHTTPAction().ConfigureAwait(false);

If you want to use the result output later its gets trickier. But if it is truly fire and forget the above should work

A Cancellation token allows interrupts and canceling procedures. If you are using Cancellation token you will need to use it everywhere from the retrieval straight through to the calling method (Turtles all the way down).

I used ConfigureAwait(false) to prevent deadlocks. Here for more information


As Amadan told in the comment that, you need to remove async from your function. then it will stop giving you the warning.

// This method has to be async
public Response SomeHTTPAction()
{
     // Some logic...
     // ...
     // Send an Email but don't care if it successfully sent.
     Task.Factory.StartNew(() =>  _emailService.SendEmailAsync());
     return MyRespond();
}

and Task.Factory.StartNew(() => _emailService.SendEmailAsync()); will indeed work on a new thread.


I am curious why this hasn't been suggested.

new Thread(() =>
{
    Thread.CurrentThread.IsBackground = true;
    //what ever code here...e.g.
    DoSomething();
    UpdateSomething();
}).Start();  

It just fires off a separate thread.