The reason I ask is this: if you are not waiting for the call, is it likely that the Task object returned the garbage collected?
As a rule, no, this should not be. The main TaskScheduler , which queues the task, usually saves a link to it for the desired lifetime until it is completed. You can see this in the TaskScheduler.QueueTask documentation:
A typical implementation will store the task in an internal data structure that will be served by threads that will perform these tasks in the future.
Your real problem will be with the ASP.NET SynchronizationContext, which keeps track of any current asynchronous operation at runtime. If your controller expires before the async operation, you will get an exception.
If you want to have "fire and forget" in ASP.NET, you must definitely register them at runtime with ASP.NET, either through HostingEnvironment.QueueBackgroundWorkItem or BackgroundTaskManager
source share