Open Closed

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


0
andmattia created

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


5 Answer(s)
  • 0
    EngincanV created
    Support Team

    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.

  • 0
    andmattia created

    Hi

    I found this possibile solution

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

    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.

  • 0
    andmattia created

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

  • 0
    EngincanV created
    Support Team

    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.