question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't create component as it has dependencies to be satisfied....

See original GitHub issue

Hi,

  • ABP 2.2.1
  • .Net Framework 4.61 MVC

Sorry to report one of these again, but I just cannot see why one service can be resolved and another cannot.

Can’t create component ‘TreasureApp.Web.Controllers.HomeController’ as it has dependencies to be satisfied.

‘TreasureApp.Web.Controllers.HomeController’ is waiting for the following dependencies:

  • Service ‘TreasurePlatform.Application.Services.SubServices.DboContactDetails.ITpDboContactDetailsService’ which was not registered.

[HandlerException: Can’t create component ‘TreasureApp.Web.Controllers.HomeController’ as it has dependencies to be satisfied. ‘TreasureApp.Web.Controllers.HomeController’ is waiting for the following dependencies:

  • Service ‘TreasurePlatform.Application.Services.SubServices.DboContactDetails.ITpDboContactDetailsService’ which was not registered. ] Castle.MicroKernel.Handlers.DefaultHandler.AssertNotWaitingForDependency() +18 Castle.MicroKernel.Handlers.DefaultHandler.ResolveCore(CreationContext context, Boolean requiresDecommission, Boolean instanceRequired, Burden& burden) +186 Castle.MicroKernel.Handlers.DefaultHandler.Resolve(CreationContext context, Boolean instanceRequired) +23 Castle.MicroKernel.Handlers.AbstractHandler.Resolve(CreationContext context) +12 Castle.MicroKernel.DefaultKernel.ResolveComponent(IHandler handler, Type service, IDictionary additionalArguments, IReleasePolicy policy) +107 Castle.MicroKernel.DefaultKernel.Castle.MicroKernel.IKernelInternal.Resolve(Type service, IDictionary arguments, IReleasePolicy policy) +42 Castle.MicroKernel.DefaultKernel.Resolve(Type service, IDictionary arguments) +14 Castle.Windsor.WindsorContainer.Resolve(Type service) +13 Abp.Dependency.IocManager.Resolve(Type type) +38 Abp.Web.Mvc.Controllers.WindsorControllerFactory.GetControllerInstance(RequestContext requestContext, Type controllerType) +69 System.Web.Mvc.DefaultControllerFactory.CreateController(RequestContext requestContext, String controllerName) +88 System.Web.Mvc.MvcHandler.ProcessRequestInit(HttpContextBase httpContext, IController& controller, IControllerFactory& factory) +195 System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state) +50 System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContext httpContext, AsyncCallback callback, Object state) +48 System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData) +16 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +443 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +157

My controller code is:

  public partial class HomeController : TreasureAppControllerBase
    {
        private ITpDboContactDetailsService _ContactDetailService;
        private ITpDboFamilyMembersService _FamilyService;

        public HomeController(ITpDboContactDetailsService aContactDetailsService, ITpDboFamilyMembersService aFamilyMembersService)
        {
            _ContactDetailService = aContactDetailsService;
            _FamilyService = aFamilyMembersService;
        }

        public virtual ActionResult Index()
        {
            return View();
        }
    }

And as you can see the Contact Details and Families services are declared “alongside” each other:

image

The ITpDboFamilyMembersService resolves just fine. So why is ITpDboContactDetailsService failing?

EDIT: - I removed all the methods from ITpDboContactDetailsService and the implementation from TpDboContactDetailsService in case there was anything causing an issue there. However it made no difference.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

4reactions
acjhcommented, Aug 29, 2017

Did you spell the implementation TpDboContactDetailsService wrongly? File name is missing a D.

0reactions
lenwebelcommented, May 15, 2018

AutoGen marked IMyAppService as internal 😦 pretty obvious really luckily didnt spend too long on this one 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - Can't create component as it has dependencies to be ...
I am getting an error while running a test. How do I solve this? ... The error: Test Name: ABC.XYZ.Tests.PQR.TestAppService_Test.
Read more >
How to solve Can't create component as it has ...
How to solve Can't create component as it has dependencies to be satisfied in ASP.NET Boilerplate? Getting error while running test.
Read more >
Can't create component 'somethingcontroller' as it has ...
as it has dependencies to be satisfied. app.web.controllers.security.userscontroller is waiting for the following dependencies: Services: - app.
Read more >
C# – Can't create component as it has dependencies to be ...
I am getting an error while running a test. How do I solve this? public class TestAppService : TestAppServiceBase, ITestAppService { private readonly ......
Read more >
C# – Can't create component as it has dependencies to be ...
Whenever I fire up the app it gives me this error: Can't create component 'TestApp.Services.MemberInfo.MemberAppService' as it has dependencies to be satisfied.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found