问题
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