The classic mistake:
Task.Run(() => DoWork());
Exceptions inside fire-and-forget tasks are lost forever → task silently dies.
✔ Correct Pattern
_ = Task.Run(async () =>
{
try
{
await DoWork();
}
catch (Exception ex)
{
logger.LogError(ex, "Background task failed");
}
});
💡 Why This Saves Lives
Silent exceptions = random missing jobs.
