I\'m getting this error in Login Controller.
InvalidOperationException: Unable to resolve service for type \'Microsoft.AspNetCore.Identity.UserManager
You need to use the same user data model in SignInManager, UserManager and services.AddIdentity. Same principal is true if you are using your own custom application role model class.
So, change
services.AddIdentity(options =>
{
options.User.RequireUniqueEmail = false;
})
.AddEntityFrameworkStores()
.AddDefaultTokenProviders();
to
services.AddIdentity(options =>
{
options.User.RequireUniqueEmail = false;
})
.AddEntityFrameworkStores()
.AddDefaultTokenProviders();