【问题标题】:Using HangFire without any Dashboard在没有任何仪表板的情况下使用 HangFire
【发布时间】:2016-09-02 13:33:07
【问题描述】:

我正在使用带有ASP.NET Core v1.0 的 Hangfire.AspNetCore。

我的数据库是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.

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

有人可以帮忙吗?

【问题讨论】:

    标签: sqlite asp.net-core hangfire


    【解决方案1】:

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

    如果您的后台作业不需要持久存储,则可以通过 Nuget 获得名为 Hangfire.MemoryStorage 的内存存储。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-08-02
      • 1970-01-01
      • 2017-03-08
      • 2022-08-04
      相关资源
      最近更新 更多