I'm triying to implement hangfire in my projects. I have a issue when I add a RecurringJob to hangfire, when it's fired i get this error:
Autofac.Core.Registration.ComponentNotRegisteredException
The requested service 'XXXX.Services.ScheduleTasks.RepairNotificationSevice' has not been registered. To avoid this exception, either register a component to provide the service, check for service registration using IsRegistered(), or use the ResolveOptional() method to resolve an optional dependency.
I have installed hangfire and hangfire.autofac. I added hangfire configuration in my Startup.cs but my ContainerBuilder data is in another file. My startup.cs file look like:
app.UseHangfire(config =>
{
config.UseSqlServerStorage("EmacIntranetEntities");
config.UseServer();
var builder = new ContainerBuilder();
config.UseAutofacActivator(builder.Build());
});
It not works. I have check to paste all Container builder data between var builder and config.UseAutofacActivator without result. My Autofac configuration is in a file named "Bootstrapper.cs" called from Global.asax. How can I resolve this issue? Thanks