I have an ASP.NET Web Forms application just set up to use Hangfire. I want to use SQL Server as storage so added the line called from global.asax:
GlobalConfiguration.Configuration.UseSqlServerStorage(mySetting.ConnectionString);
The HangFire tables have been created in the database and I have used the following code to add jobs to the queue:
BackgroundJob.Enqueue(() => Utils.WriteToTextFileOnServer());
I can see that the jobs have been created in the database but it seems the jobs are stuck in state Enqueued and never gets fetched by the application.
Have I missed something? Is there something more that needs to be done for HangFire to start collecting jobs?
solution: Forget to create new BackgroundJobServer