BackgroundJob.Enqueue

Hi all

I do enqueue a new background job with a command like this:

BackgroundJob.Enqueue<IMyInterface>(service => service.DoSomething(param1, param2));

Sometimes it works well, but sometimes the following exception occurs:

“The ConnectionString property has not been initialized”

It happens, the the creation works for days, but at some point in time it switches and the exception occurs for all Background jobs which are enqueued. And this happens without any change on the environment. After recycling the application pool, it works again.

This is a .Net 6 application with Hangfire 1.8.11. The recurring jobs within the same web application still work without any issues.

Thanks a lot for your help.
M.