Error Dashboard in ASp.NET web site


#1

I have installed hangfire in an ASP.NET Web site C# application, and have enabled dashboard in the Application class. Hangfire itself is working well, however I cannot get the dashboard working.
Every time I write http://mydomain/hangfire I get an 404 error. I have created a ‘hangfire’ folder under the root of the site but it stays empty and that does not help.


#2

Can you provide a sample of your Startup class?


#3
public class Startup
{
    public void Configuration(IAppBuilder app)
    {
        var connectionstring = "";

        connStringVariables cs = Utils.InitEnv();
        if (cs != null)
        {
            connectionstring = "Max Pool Size=150;server="
                    + (cs.server + (";database="
                    + (cs.database + (";user id="
                    + (cs.username + (";password=" + cs.pwd))))));
        }
        GlobalConfiguration.Configuration.UseSqlServerStorage(connectionstring);


        app.UseHangfireDashboard();
        app.UseHangfireServer();
    }
}

#4

Have you tried adding logging to your application to see if anything is wrong on the startup of hangfire?


#5

Yes, I did.

I am using Log4Net and when I start the site I can see in the log the following messages:

Start installing Hangfire SQL objects…
Hangfire SQL objects installed.
Starting Hangfire Server using job storage: ‘SQL Server: EC2AMAZ-BQ\SQL2016@ _test’
Using the following options for SQL Server job storage: Queue poll interval: 00:00:15.
Using the following options for Hangfire Server:
Worker count: 20
Listening queues: ‘default’
Shutdown timeout: 00:00:15
Schedule polling interval: 00:00:15
Server ec2amaz-bq:127260:5777703b successfully announced in 230.5239 ms
Server ec2amaz-bq:127260:5777703b is starting the registered dispatchers: ServerWatchdog, ServerJobCancellationWatcher, ExpirationManager, CountersAggregator, Worker, DelayedJobScheduler, RecurringJobScheduler…
Server ec2amaz-bq:127260:5777703b all the dispatchers started