gpt4 book ai didi

Hangfire Windows 服务仪表板

转载 作者:行者123 更新时间:2023-12-02 19:58:49 25 4
gpt4 key购买 nike

我想查看 Windows 服务项目中挂火的仪表板。我在Here中看到了解决方案但我觉得它有点旧了我没有 StartOptions 类。是否有关于在 Windows 服务上使用 Hangfire 仪表板的更好文档。

 StartOptions options = new StartOptions();

最佳答案

你发现的例子here没有任何问题它实际上已经更新了。您可能没有注意到,在使用 StartOptions() 之前,您需要先安装 Microsoft.Owin.Hosting

using Hangfire;
using Microsoft.Owin.Hosting; // --> You need to install this first

GlobalConfiguration.Configuration.UseSqlServerStorage("hangfire");
StartOptions options = new StartOptions();
options.Urls.Add("http://localhost:9095");
options.Urls.Add("http://127.0.0.1:9095");
options.Urls.Add($"http://{Environment.MachineName}:9095");

WebApp.Start<Startup>(options);

Nuget 包是 Install-Package Microsoft.Owin.Hosting;

关于Hangfire Windows 服务仪表板,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38706607/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com