Hangfire + Umbraco - issue with dependency injection

Hello,

this is my very first post, so Hello World :slight_smile:

I have a similar issue to this one: access content cache from hangfire in v10 11 whats going on - Using Umbraco And Getting Started - our.umbraco.com

Long story short: I’m trying to inject a UmbracoContextFactory and one of my custom services into my Hangfire task. All works ok if I follow the advise from the thread above, which is: I inject just UmbracoContextFactory. However when I inject also my custom service I start to receive following error:

Has anybody faced with such a issue before and can help?

Hi! I wrote a package for this in Umbraco, I can recommend using it :wink: Umbraco Marketplace | Umbraco integrations and packages

I can also recommend asking Umbraco questions on the Umbraco forums or the Umbraco Discord server. This not a Hangfire-specific question.

Finally, you didn’t post any code so I can’t tell what might have gone wrong,but this blog post might help you set it up correctly: Using Hangfire to update Umbraco content | Cultiv