Background Work in ASP.NET Core

Talk it through out loud with your AI coach.

The problem

  • hard
  • Pro

An ASP.NET Core API sends welcome emails by starting a fire-and-forget Task dot Run inside the request handler, and some emails are never sent, especially during deploys. Explain why, and how you'd do background work properly in .NET, both inside the app and when it really matters that the work happens.

What a strong answer covers

  • Why untracked work disappears.
  • The framework's way to run long-lived work inside the app.
  • Lifetime and error-handling traps inside background services.
  • When to move work out of the process to something durable.

Common mistake: Swapping Task dot Run for an in-memory queue and assuming emails can no longer be lost.

Knowing this is half of it. Saying it clearly out loud is the part the coach helps you practise.

Practise it out loud