Cannot create any jobs


#1

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);
    }

}

#2

The jobs are actually succeeding, and I have verified that there are no errors in the Hangfire dashboard. I guess I can safely ignore those exceptions.


#3

Is there already a fix for:

A first chance exception of type ‘System.ObjectDisposedException’ occurred in System.Transactions.dll?

It’s really annoying since it’s throwing an error every X seconds, so I can’t debug entire project normally :confused: