Configure “Hangfire.Net” in .NET Core console application?

我怕爱的太早我们不能终老 提交于 2019-12-14 00:06:34

问题


I am creating a console application in which I need to perform some tasks in parallel so I am trying to use Hangfire.Net.

Can anyone please suggest me how to configure Hangfire.Net in .NET Core console application?


回答1:


Configuration of Hangfire in .Net Core is quite state forward This will store it in the database.

GlobalConfiguration.Configuration.UseSqlServerStorage("connection_string");

using (var server = new BackgroundJobServer())
    {
     Console.WriteLine("Hangfire Server started. Press any key to exit...");
     Console.ReadKey();
    }

Code ripped from documentation



来源:https://stackoverflow.com/questions/49623349/configure-hangfire-net-in-net-core-console-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!