Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using HangFire without any Dashboard

I am using Hangfire.AspNetCore with ASP.NET Core v1.0.

My Database is SqlLite.

As far as I found, there is no proper SQLite driver for hangfire for .NET Core.

So, I decided to work without any dashboard.

So, what I have configured is like the following:

In Startup.cs, in ConfigureServices method

services.AddHangfire(configuration => {});

And in Configure method, I am using this

app.UseHangfireServer();

But I am getting the next error:

An exception of type 'System.InvalidOperationException' occurred in Hangfire.Core.dll but was not handled in user code

Additional information: JobStorage.Current property value has not been initialized. You must set it before using Hangfire Client or Server API.

enter image description here

I don't need dashboard, so I did not configured dashboard.

Can anyone please help?

like image 467
Abrar Jahin Avatar asked Sep 01 '16 11:09

Abrar Jahin


1 Answers

The error is telling you that you have not configured a job storage provider. It's got nothing to do with the dashboard. Even without the dashboard you must have a storage provider.

There is in-memory storage available via Nuget called Hangfire.MemoryStorage that you can use if you don't require persistent storage for your background jobs.

like image 128
Brad Avatar answered Oct 25 '22 08:10

Brad