Can't create component as it has dependencies to be satisfied....
See original GitHub issueHi,
- 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:
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:
- Created 6 years ago
- Comments:8 (6 by maintainers)
Top GitHub Comments
Did you spell the implementation
TpDboContactDetailsService
wrongly? File name is missing aD
.AutoGen marked IMyAppService as internal 😦 pretty obvious really luckily didnt spend too long on this one 😃