The issue was that I wasn’t await
-ing the async method in Main
. Since DoSomethingAsync()
returns a Task, and I didn’t await it, the program just moved on and printed "Done" without waiting for the async part to finish.
Here’s the fixed version:
static async Task Main(string[] args)
{
await DoSomethingAsync();
Console.WriteLine("Done");
}