✅ How do I gracefully asynchronously exit a console application?
I am working on a console application that runs an asynchronous method until the console application exits. I want to gracefully exit this method and handle remaining work before fully closing.
The code currently looks like this (only relevant code shared)
Expected: The console logs
Actual: The last message was
Is this possible at all? I want to add additional logic below before the console is exited, but I can't figure out the correct way of doing this.
The code currently looks like this (only relevant code shared)
Program.cs: https://gdl.space/acabuvokev.csBotApplication.cs: https://gdl.space/tumeduveko.csExpected: The console logs
Stopped application..Actual: The last message was
Starting bot..Is this possible at all? I want to add additional logic below before the console is exited, but I can't figure out the correct way of doing this.