I am Implementing Identity in Dot Net core MVC 7. This is the tutorial I was Following. Then Suddenly Error Came Error Came
An unhandled exception occurred while processing the request.
InvalidOperationException: Unable to resolve service for type 'Microsoft.AspNetCore.Identity.UserManager`1[Microsoft.AspNetCore.Identity.IdentityUser]' while attempting to activate 'LearnIdentity.Areas.Identity.Pages.Account.RegisterModel'.
Microsoft.Extensions.DependencyInjection.ActivatorUtilities.GetService(IServiceProvider sp, Type type, Type requiredBy, bool isDefaultParameterRequired)
I tried re-watching video again and again. Tried chat GTP. Unable to relsove please help me Click here for Source code
I download your repo and reproduce the issue in my side when click the login button.
Error
Then I check the
Program.csfile andlogin.cshtml,login.cshtml.csfile. You are usingApplicationUserinProgram.csand usingIdentityUserinlogin.cshtml.cs.The solution is using
ApplicationUserinlogin.cshtml.cs. And the issue will be fixed. And please don't forget addusing LearnIdentity.Data;inlogin.cshtml.csIt works in my side