Hi, I have this project that works like a soap api for some external interaction. I need to use the background job manager there to add a time consuming task to the queue. How can i accomplish it?
Trying to inject gives the following error:
System.AggregateException: 'Some services are not able to be constructed (Error while validating the service descriptor 'ServiceType: my.app.Services.Inv Lifetime: Singleton ImplementationType: my.app.Services.Inv': Unable to resolve service for type 'Abp.Dependency.IIocResolver' while attempting to activate 'Abp.BackgroundJobs.BackgroundJobManager'.) (Error while validating the service descriptor 'ServiceType: Abp.BackgroundJobs.IBackgroundJobManager Lifetime: Singleton ImplementationType: Abp.BackgroundJobs.BackgroundJobManager': Unable to resolve service for type 'Abp.Dependency.IIocResolver' while attempting to activate 'Abp.BackgroundJobs.BackgroundJobManager'.)'
thank you
5 Answer(s)
-
0
Hi @uenlkr4e,
Can you show your implementation code?
-
0
It is something like this:
public class DoSomething : DoSomethingPortType {
private readonly ISignService _signer; private readonly IValidateService _validator; private readonly ISerializerService _serializer; private readonly IBackgroundJobManager _backgroundJobManager; public DoSomething(ISignService signer, IValidateService validator, ISerializerService selializer, IBackgroundJobManager backgroundManager) { _validator = validator; _signer = signer; _serializer = selializer; _backgroundJobManager = backgroundManager; }
-
0
Hi @uenlkr4e,
Could you try to implement
ITransientDependency
toDoSomething
class? -
0
I get the error at Program.cs.
All my other manager classes can be injected and used with no problem but this background manager gives the error. This app is a regular .net core app that uses var builder = WebApplication.CreateBuilder(args); object to run.
How can i use background manager here?
-
0
Hi,
In order to use ABP's functionality in a different application, you need to create a module and configure Program.cs as shown here https://github.com/aspnetboilerplate/aspnetboilerplate-samples/tree/master/AbpEfConsoleApp/AbpEfConsoleApp