Hi everyone,
I have read the forum but I have not found an answer to my problem. I am using MVC5.
I have followed theese instructions: Sending Mail in Background with ASP.NET MVC — Hangfire Documentation
So im my startup.cs file I have added the following code:
public partial class Startup
{
public void ConfigureHangfire(IAppBuilder app)
{
var sqlOptions = new SqlServerStorageOptions
{
QueuePollInterval = TimeSpan.FromSeconds(1)
};
GlobalConfiguration.Configuration
.UseSqlServerStorage("Accounts", sqlOptions)
.UseFilter(new LogEmailFailureAttribute());
app.UseHangfireDashboard();
app.UseHangfireServer();
}
}
Then I call the method:
[assembly: OwinStartupAttribute(typeof(Intranet.Startup))]
namespace Intranet
{
public partial class Startup
{
public void Configuration(IAppBuilder app)
{
ConfigureHangfire(app);
}
}
}
No exception is raised.
Then I try to send an email in backgroud, but my background job never run. In my dashboard I can see the enqueued job but I do not see any active server.
I am using SQL Server.
Can anyone help me to understand why the server do not start?
Thank you