# Unable to resolve service for type 'Hangfire.IBatchJobClient' while attempting to activate '...'

**URL:** <https://discuss.hangfire.io/t/unable-to-resolve-service-for-type-hangfire-ibatchjobclient-while-attempting-to-activate/8909>\
**Category:** bug?\
**Tags:** hangfire-pro, aspnetcore\
**Created:** [January 21, 2022, 1:47pm UTC](https://discuss.hangfire.io/t/unable-to-resolve-service-for-type-hangfire-ibatchjobclient-while-attempting-to-activate/8909 "2022-01-21T13:47:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![AlexNL](https://dub1.discourse-cdn.com/flex017/user_avatar/discuss.hangfire.io/alexnl/32/2796_2.png) [@AlexNL](https://discuss.hangfire.io/u/AlexNL)\
**Post date:** [January 21, 2022, 1:47pm UTC](https://discuss.hangfire.io/t/unable-to-resolve-service-for-type-hangfire-ibatchjobclient-while-attempting-to-activate/8909/1 "2022-01-21T13:47:05Z")

</div>

Hi there,

I’m a satisfied user of Hangfire, and I’ve recently started using Hangfire Pro. Its batch functionality is great and works well when I invoke it via the static `BatchJob.StartNew()` methods.

I’m now trying to start a batch job using constructor based dependency injection (I dislike using statics) but when I try it like this, the DI container is unable to instantiate my job as it has no registration for `IBatchJobClient`.

Is there a registration step I’m missing (I’ve not found a `services.AddHangfirePro()` method), or do I have to do a registration step myself?

---

<div class="post-metadata">

**Author:** ![odinserj](https://dub1.discourse-cdn.com/flex017/user_avatar/discuss.hangfire.io/odinserj/32/648_2.png) [@odinserj](https://discuss.hangfire.io/u/odinserj)\
**Post date:** [January 21, 2022, 3:51pm UTC](https://discuss.hangfire.io/t/unable-to-resolve-service-for-type-hangfire-ibatchjobclient-while-attempting-to-activate/8909/2 "2022-01-21T15:51:46Z")

</div>

Hi Alex,

Yes, unfortunately there’s no integration package for batches and .NET Core yet, and `IBatchJobClient` should be registered with:

```auto
services.AddSingleton<IBatchJobClient>(
    x => new BatchJobClient(x.GetRequiredService<JobStorage>()));

```
