Base solution for your next web application
Open Closed

Dependency Injection Error #344


User avatar
0
relix3000 created

Hi! I've been fighting with this error for a while now and I am about to break down :lol: I started an original ABP template with Entity and MVC (not SPA). I needed authentication so I added the module-zero to his existing project. I created the classes as per the documentation and additionally created a ABP Module Zero project so I could compare the codes. After some fine tuning, it all compiles! Yet, as soon as I try to access the login page I get a dependency injection error.

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

'NetCoop.Users.UserManager' is waiting for the following dependencies:
- Service 'NetCoop.Users.UserStore' which was registered but is also waiting for dependencies.
'NetCoop.Users.UserStore' is waiting for the following dependencies:
- Service 'Abp.Domain.Repositories.IRepository`2[[NetCoop.Users.User, NetCoop.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[System.Int64, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]' which was not registered.
- Service 'Abp.Domain.Repositories.IRepository`1[[NetCoop.Authorization.Roles.Role, NetCoop.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]' which was not registered.
- Service 'NetCoop.Authorization.Roles.RoleManager' which was registered but is also waiting for dependencies.
'NetCoop.Authorization.Roles.RoleManager' is waiting for the following dependencies:
- Service 'NetCoop.Authorization.Roles.RoleStore' which was registered but is also waiting for dependencies.
'NetCoop.Authorization.Roles.RoleStore' is waiting for the following dependencies:
- Service 'Abp.Domain.Repositories.IRepository`1[[NetCoop.Authorization.Roles.Role, NetCoop.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]' which was not registered.
- Service 'Abp.Domain.Repositories.IRepository`1[[NetCoop.MultiTenancy.Tenant, NetCoop.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]' which was not registered.

I verified the code line by line with the project and documentation and its all the same! What is going wrong?


2 Answer(s)
  • User Avatar
    0
    hikalkan created
    Support Team

    Have you inherited your DbContext from AbpZeroDbContext?

  • User Avatar
    0
    relix3000 created

    Hi Hikalkan, the error was mine. I had a previous set of models I was using to work with and were being left over. Sorry to waste your time!