Skip to content

Recurring job, cannot resolve type #21

@provanguard

Description

@provanguard

I took the Activator code from this solution and placed it inside my .NET Core 2.0 MVC Web API project. I added it to the Hangfire configuration (this part is not documented here, so could be wrong):

GlobalConfiguration.Configuration.UseActivator(new SimpleInjectorJobActivator(_container));
app.UseHangfireServer();

I found out that while simple recurring job to print out something to the Console works fine, when attempting to run a job that gets constructor parameters via SimpleInjector, it fails with an "Unable to resolve service" error:

Unable to resolve service for type 'xxx.Infrastructure.Persistence.IRepository' while attempting to activate 'xxx.xxx.xxx.Jobs.NewJob'.

Since the whole point of using this integration solution is to make it work with SimpleInjector, there appears to be a fundamental problem with it. Or simply, we are missing proper documentation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions