.net core Error

InvalidOperationException: Unable to resolve service for type 'Microsoft.AspNetCore.Identity.RoleManager1[Microsoft.AspNetCore.Identity.IdentityRole1[System.Int32]]' while attempting to activate 'Library.Controllers.AccountController'. Microsoft.Extensions.DependencyInjection.ActivatorUtilities.ThrowHelperUnableToResolveService(Type type, Type requiredBy) what is the solution of this error?
5 Replies
Anton
Anton7mo ago
It's saying there's no service registered for that type. You need to register that service. RoleManager should be added by one of the high level initialization methods in Identity
yusufkenangirgin
yusufkenangirginOP7mo ago
Thank you for your answer but how can I do this?
Anton
Anton7mo ago
do you know what DI is? service provider?
yusufkenangirgin
yusufkenangirginOP7mo ago
I dont know? If I can write DI may be I get solution.
Anton
Anton7mo ago
well learn DI then it's a fundamental thing

Did you find this page helpful?