I’m using a popular MediatR package which works fine with IoC but combining with hangfire, my breakpoint does not get hit in my handler. I saw this post http://codeopinion.com/mediator-pattern-hangfire/ and I set the serialization settings but it still does not get hit.Can one usually debug the method that is being passed in? In my case --> _mediator.Send(loginRequest) which sends it to a handler. I use StyructureMap and the _mediator is set correctly as it works fine on non-hangfire code. The method below is called within my mvc controller action.
I have a method:
RecurringJob.AddOrUpdate(“informatica-job”, () => _mediator.Send(loginRequest), “*/15 * * * *”);
I also have:
public class LoginHandler : RequestHandler<JobWorkflow.LoginRequest>
{
private readonly IMediator _mediator;
public LoginHandler(IMediator mediator)
{
_mediator = mediator
}
protected override void HandleCore(LoginRequest loginRequest)
{
//**************** does not get hit at all**************
}
}
UPDATE: In fact I can’t debug any method passed in to recurring job. How does one debug the method passed in at all with hangfire?