hangfire 本地可以正常打开hangfire页面,发布后报401

  1. 本地可以正常打开hangfire页面,发布后报401
解决办法
增加CustomAuthorizeFilter
public class CustomAuthorizeFilter : IDashboardAuthorizationFilter
    {
        public bool Authorize([NotNull] DashboardContext context)
        {
            return true;
        }
        public CustomAuthorizeFilter()
        {            
        }
    }
新增类

Configure增加配置,代码也可以其他地方,用下面代码替换原先 app.UseHangfireDashboard() 即可。

  app.UseHangfireDashboard("/hangfire", new DashboardOptions
            {
                Authorization = new[] { new CustomAuthorizeFilter() }
            }); 
  1.  hangfire 关键任务表

select [Key] from [dbo].[Hash] group by [Key];
select * from [dbo].[Set];

原文地址:https://www.cnblogs.com/xbding/p/15099942.html