Open Closed

How to add HangFire dashboard in a consoleapp/service #4100


User avatar
0
andmattia created

How can I add a HangFire Dashboar to my console APP/winService?


5 Answer(s)
  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    Hi, you can not add Hangfire Dashboard into a console application. Please see the documentation for related configurations on the asp.net core application.

    Best Regards.

  • User Avatar
    0
    andmattia created

    Hi

    I found this possibile solution

    .ConfigureWebHostDefaults(builder =>
                {
                    builder.Configure(app =>
                    {
                        app.UseRouting();
    
                        app.UseHangfireDashboard();
                        app.UseEndpoints(endpoints =>
                        {
                            endpoints.MapHangfireDashboard();
                        });
                    });
                })
    
  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    Hi

    I found this possibile solution

    .ConfigureWebHostDefaults(builder => 
                { 
                    builder.Configure(app => 
                    { 
                        app.UseRouting(); 
     
                        app.UseHangfireDashboard(); 
                        app.UseEndpoints(endpoints => 
                        { 
                            endpoints.MapHangfireDashboard(); 
                        }); 
                    }); 
                }) 
    

    When you do that your application becomes a web application, you are configuring a web host you can do this if it's not causing any problems for you.

  • User Avatar
    0
    andmattia created

    Hi I know but I don't found any other solution

  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    Hi I know but I don't found any other solution

    If you want to see the hangfire dashboard which corresponds to a web page, you should do it as you mentioned above (i mean you should go with a web application instead of a console application).

    I close the question since this is not a question that is fully related to ABP Framework. Best Regards.

Made with ❤️ on ABP v9.1.0-preview. Updated on November 01, 2024, 05:35