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

标签 sqlite asp.net-core 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

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

有人可以帮忙吗?

最佳答案

该错误提示您尚未配置作业存储提供程序。跟仪表盘没关系。即使没有仪表板,您也必须有一个存储提供程序。

如果您的后台作业不需要持久存储,您可以使用名为 Hangfire.MemoryStorage 的 Nuget 内存存储。

关于sqlite - 在没有任何仪表板的情况下使用 HangFire,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39270279/

相关文章:

sql - Group By + 左外连接 Sqlite

c# - 如何在Sqlite中使用通配符匹配目录路径

macos - 为什么在 MacOS 上部署 ASP.NET-Core 应用程序时会收到错误消息 "Locking/unlocking file regions is not supported on this platform."?

sql-server - AspNetUserLogins 表和 SQL Server 中索引键的最大大小

c# - Hangfire 依赖注入(inject)生命周期范围

java - Android应用程序: Error: Android.数据库。CursorIndexOutOfBoundsException : Index 0 requested,,大小为0

java - 直接在 SQLite 数据库中使用 getter 和 setter

asp.net-core - 当 dotnet 测试的覆盖率低于目标时,Azure DevOps 构建不会失败

asp.net-mvc-5 - 除非仪表板打开,否则 Hangfire 不会处理重复作业

c# - WebAPI + OWIN + SignalR + Autofac