UseHangfireServer 抛出异常

UseHangfireServer throws exception

我的 ASP.NET Boilerplate Core 2.0 应用程序有问题。

我在应用层做了很多工作,现在我想尝试 MVC 项目中的代码。但是当我尝试启动应用程序时出现以下错误:

System.InvalidOperationException: 'Unable to find the required services. Please add all the required services by calling 'IServiceCollection.AddHangfire' inside the call to 'ConfigureServices(...)' in the application startup code.'

第(102)行出现此错误: app.UseHangfireServer();

我不知道hangfire有什么问题。我没有更改 startup.cs 文件中的代码。

这是错误消息告诉您的操作:

services.AddHangfire(config =>
{
    config.UseSqlServerStorage(_appConfiguration.GetConnectionString("Default"));
});

the line之前添加以上内容:

services.AddScoped<IWebResourceManager, WebResourceManager>();