Hosted Service scope when running as Azure Web Job

Working on a BackgroundService that is published to Azure as a Web Job, I noticed something strange (works fine on Azure, exception when running locally), so I tried to recreate the situation. Program.cs: using TestBackgroundJob; IHost host = Host.CreateDefaultBuilder(args) .ConfigureServices(services => { services.AddScoped<IDummyService, DummyService>(); services.AddHostedService<Worker>(); }) .Build(); await host.RunAsync(); Worker public class Worker : BackgroundService… Read More Hosted Service scope when running as Azure Web Job

How can I troubleshoot my ASP.NET Core hosted service not working?

Problem with trying to add the Hosted Service to the Application I’m trying to add Hosted Service to my application, but it seems not to work at all (In debug none of its methods were called). Here is the code of Hosted Service: using Data.Data; namespace Shop.HostedServices; public sealed class ChangeOrderStatusHostedService : IHostedService, IDisposable {… Read More How can I troubleshoot my ASP.NET Core hosted service not working?