ASP.NET – How to use a BackgroundService for long-running and periodic tasks

In ASP.NET, when you need a long-running background task, or need to run a task periodically, you can implement IHostedService or BackgroundService and register your class as a hosted service in Startup. As you may have already encountered, if you try to run a long-running background task, the web server will randomly kill your task … Read more ASP.NET – How to use a BackgroundService for long-running and periodic tasks