I am just following the user’s guide at the moment, and I’m having issues creating a recurring job.
I keep getting these errors:
A first chance exception of type ‘System.InvalidOperationException’ occurred in HangFire.Core.dll
A first chance exception of type ‘Hangfire.Common.JobLoadException’ occurred in HangFire.Core.dll
A first chance exception of type ‘System.ObjectDisposedException’ occurred in System.Transactions.dll
A first chance exception of type ‘System.ObjectDisposedException’ occurred in System.Transactions.dll
Here is the code in my Startup class:
public class Startup
{
public void Configuration(IAppBuilder app)
{
app.UseHangfire(config =>
{
string connectionString = "SQLExpress";
config.UseSqlServerStorage(connectionString);
config.UseServer();
});
// Set up the recurring indexing job here
//BackgroundJob.Enqueue(() => Console.WriteLine("Hello, world!"));
RecurringJob.AddOrUpdate(() => Console.Write("Easy!"), Cron.Minutely);
}
}