Open xcd1111232 opened 6 months ago
Honestly, not an ideal issue title or description. I'm not surprised that you haven't gotten any responses so far. From (lack of) context, I'm guessing that you are not calling the UseHangfireDashboard
method and are using BackgroundJob
or RecurringJob
which would lead to this exception because those static classes rely on specific global initialization to happen before they can be used. But really, without any more information about the context in which you're getting this exception, the pretty detailed exception message is as good as it is going to get in terms of answering the "why".
System.InvalidOperationException:“Current JobStorage instance has not been initialized yet. You must set it before using Hangfire Client or Server API. For .NET Core applications please call the
IServiceCollection.AddHangfire
extension method from Hangfire.NetCore or Hangfire.AspNetCore package depending on your application type when configuring the services and ensure service-based APIs are used instead of static ones, likeIBackgroundJobClient
instead ofBackgroundJob
andIRecurringJobManager
instead ofRecurringJob
.”