So I’m using dotnetcore 1.1 and it appears that after making my Configure
method in Startup.cs asynchronous, I can’t view the dashboard. Is there something I’m doing incorrectly?
I am using the following code under .net core 1.1, without issues. Maybe it helps you.
public void ConfigureServices(IServiceCollection services)
{
//alle dingen bekijken
foreach (var item in _settings.AsEnumerable())
{
Console.WriteLine($"{item.Key} ---- {item.Value}");
}
var redisHostname = _settings["ConnectionSettings:Redis:RedisHostName"];
var redisPort = _settings["ConnectionSettings:Redis:RedisPort"];
var hangfirePrefix = _settings["ConnectionSettings:Redis:HangfirePrefix"];
var ipAddress = Dns.GetHostAddressesAsync(redisHostname).Result.First(i => !i.ToString().StartsWith(":"));
services.AddHangfire(x =>
{
x.UseRedisStorage($"{ipAddress}:{redisPort}", new RedisStorageOptions
{
Prefix = hangfirePrefix,
InvisibilityTimeout = TimeSpan.FromHours(12)
});
});
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
{
app.UseHangfireDashboard("", new DashboardOptions
{
Authorization = Enumerable.Empty<Hangfire.Dashboard.IDashboardAuthorizationFilter>()
});
}