ASP.NET Core 5 application: HTTP 500.30 in production

Tags: #<Tag:0x00007f7b5e221dd0>

Hello community,

I have just configured Hangfire to have some scheduled tasks done, it works fine in development mode but when I publish my app to IIS the application cannot start and provides a 500.30

After I commented out all of the Hangfire code in Startup.cs and re-deploy, the application starts and functions normally

Has anyone else encountered this issue and/or has any tips on how to resolve this?

I found out that the app crashes when the foreach is out-commented:

                using (var connection = JobStorage.Current.GetConnection())
            //        foreach (var recurringJob in connection.GetRecurringJobs())
             //       {
           //             RecurringJob.RemoveIfExists(recurringJob.Id);
            //        }

When I Query the database, it says all Hangfire tables are empty

Warm regards