Я установил пакеты:
Hangfire.AspNetCore
Hangfire.MemoryStorage.Core
Вот мой код:
using Hangfire;
using Hangfire.MemoryStorage;
public void ConfigureServices(IServiceCollection services)
{
services.AddHangfire(c => c.UseStorage(GlobalConfiguration.Configuration.UseMemoryStorage()));
services.AddMvc();
}
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
app.UseHangfireServer();
}
...
public static void Main(string[] args)
{
RecurringJob.AddOrUpdate(() => Console.Write("Easy!"), Cron.Minutely);
}
Однако я получаю сообщение об ошибке:
JobStorage.Current property value has not been initialized. You must set it before using Hangfire Client or Server API.
Мое приложение работает на ASP.NET Core
.