Closed mjohnson0580 closed 7 years ago
This was a tmp replacement for a problem in AspNetCore that has been fixed now in 2.1.
Although there is a workaround needed for actually passing the function of another assembly. A local function needs to be passed.
So instead of
BackgroundJob.Enqueue(() => Console.WriteLine("Background Job: Hello, world!"));
use
BackgroundJob.Enqueue(() => Test());
[AutomaticRetry(Attempts = 2, LogEvents = true, OnAttemptsExceeded = AttemptsExceededAction.Delete)]
public static void Test()
{
Console.WriteLine("Background Job: Hello, world!"));
}
I have added this as another issue #14
The latest version doesn't appear to be working in ASP.Net applications.
When making a call to BackgroundJob.Enqueue I am getting the following exception:
I believe this is due to Assembly.GetEntryAssembly() returning null on the following line: https://github.com/cady-io/hangfire-ravendb/blob/c65b8b13143302424763c2d5d76eeed68a2e225c/src/Hangfire.Raven/RavenJsonConverters.cs#L90
The same error would also occur here: https://github.com/cady-io/hangfire-ravendb/blob/c65b8b13143302424763c2d5d76eeed68a2e225c/src/Hangfire.Raven/RavenJsonConverters.cs#L107