sqlite – 在没有任何仪表板的情况下使用HangFire

前端之家收集整理的这篇文章主要介绍了sqlite – 在没有任何仪表板的情况下使用HangFire前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我使用的是Hangfire.AspNetCore和 ASP.NET Core v1.0.

我的数据库SqlLite.

据我所知,.NET Core的hangfire没有适当的sqlite驱动程序.

所以,我决定在没有任何仪表板的情况下工作.

所以,我配置的内容如下:

在Startup.cs中,在ConfigureServices方法

services.AddHangfire(configuration => {});

在Configure方法中,我正在使用它

app.UseHangfireServer();

但我得到了下一个错误

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

我不需要仪表板,所以我没有配置仪表板.

有人可以帮忙吗?

解决方法

错误告诉您尚未配置作业存储提供程序.它与仪表板无关.即使没有仪表板,您也必须拥有存储提供商.

通过Nuget提供的内存存储称为Hangfire.MemoryStorage,如果您不需要持久存储用于后台作业,则可以使用它.

猜你在找的Sqlite相关文章