Base solution for your next web application
Open Closed

Using BackgroundJobManager in WCF soap service #12329


User avatar
0
uenlkr4e created

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)
  • User Avatar
    0
    m.aliozkaya created
    Support Team

    Hi @uenlkr4e,

    Can you show your implementation code?

  • User Avatar
    0
    uenlkr4e created

    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;
        }
    
  • User Avatar
    0
    m.aliozkaya created
    Support Team

    Hi @uenlkr4e,

    Could you try to implement ITransientDependency to DoSomethingclass?

  • User Avatar
    0
    uenlkr4e created

    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?

  • User Avatar
    0
    ismcagdas created
    Support Team

    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