教程:ASP.NET Core MVC上的Redis上的Hangfire

入门

要在ASP.NET Core MVC项目中针对Redis使用Hangfire,首先需要安装至少以下两个软件包:Hangfire.AspNetCoreHangfire.Redis.StackExchange

Startup.cs,这些都是最起码,你将需要编写使迟发型对Redis的代码:

public class Startup
{
    

    public void ConfigureServices(IServiceCollection services)
    {
        services.AddHangfire(configuration =>
        {
            configuration.UseRedisStorage("localhost");
        });
    }

    public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
    {
        app.UseHangfireServer();
    }
}

注意:我这里安装了 Hangfire.Redis.StackExchange.StrongName 这个包才能成功

 

相关文章:

  • 2021-04-11
  • 2021-12-16
  • 2021-07-01
  • 2021-09-30
  • 2022-02-17
  • 2021-11-13
猜你喜欢
  • 2021-11-11
  • 2021-11-10
  • 2021-06-16
  • 2022-12-23
相关资源
相似解决方案