首页 > 解决方案 > .netcore 2.0 控制台 UseHangfireDashboard 扩展不可用

问题描述

在此处输入图像描述 我创建了一个新的 .net core 2.0 控制台项目。

    using Hangfire;
    using Microsoft.Owin;
    using Owin;
    [assembly: OwinStartup(typeof(Test.WorkerHost))]
    namespace Test.worker
    {
        public class WorkerHost
        {
            public void Configuration(IAppBuilder app)
            {
                app.UseHangfireDashboard(); // This is not available
            }
        }
    }

所有示例都提到像上面那样配置hangfire,但我没有得到那些扩展方法。已经通过了

http://docs.hangfire.io/en/latest/configuration/using-dashboard.html

如何在 .NET Core 控制台应用程序中配置“Hangfire.Net”?

任何想法?

标签: hangfire.net-core-2.0hangfire-console

解决方案


好吧,经过反复试验。我通过添加 Hangfire.AspnetCore nuget 并使用 IApplicationBuilder 而不是 IAppBuilder 来实现它。


推荐阅读