I created a console application with TopShelf. Now I need to add Hangfire and Owin to activate the Hangfire dashboard. The problem is on my IAppBuilder instance that doesn't have any UseHangfire.
I installed Hangfire and Hangfire.AspNetCore but nothing works.
using Hangfire;
using Hangfire.SqlServer;
using Hangfire.Dashboard;
using Owin;
namespace MyNamespace
{
public class Startup
{
public void Configuration(IAppBuilder app)
{
app.UseHangfireDashboard(); // <-- Method not found
}
}
}
I realy don't undestand where is the problem.
I would not use Topshelf anymore, since .NET 3.1 there is a new service available called "BackgroundService"
https://learn.microsoft.com/en-us/dotnet/core/extensions/windows-service?pivots=dotnet-7-0
Else there must be some documentation running Topshelf on .NET 6 or .NET 7
You can create it with something like this (I haven't tested it)