.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
Anton4mo 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
yusufkenangirginOP4mo ago
Thank you for your answer but how can I do this?
Anton
Anton4mo ago
do you know what DI is? service provider?
yusufkenangirgin
yusufkenangirginOP4mo ago
I dont know? If I can write DI may be I get solution.
Anton
Anton4mo ago
well learn DI then it's a fundamental thing
Want results from more Discord servers?
Add your server