Asp.net core 如何更改Asp.net core 2.2中AddDefaultIdentity的默认泛型类型

Asp.net core 如何更改Asp.net core 2.2中AddDefaultIdentity的默认泛型类型,asp.net-core,asp.net-identity,asp.net-core-2.2,Asp.net Core,Asp.net Identity,Asp.net Core 2.2,我创建了一个继承IdentityUser的ApplicationUser类,然后在StartUp类中,我将服务。添加DefaultIdentity泛型类型从IdentityUser更改为ApplicationUser,因此我可以获得UserManager的服务,而不是UserManager services.AddDefaultIdentity() .AddDefaultUI(UIFramework.Bootstrap4) .AddEntityFrameworkStores(); 我犯了这个错

我创建了一个继承
IdentityUser
ApplicationUser
类,然后在
StartUp
类中,我将
服务。添加DefaultIdentity
泛型类型从
IdentityUser
更改为
ApplicationUser
,因此我可以获得
UserManager
的服务,而不是
UserManager

services.AddDefaultIdentity()
.AddDefaultUI(UIFramework.Bootstrap4)
.AddEntityFrameworkStores();
我犯了这个错误

InvalidOperationException:未注册类型为“Microsoft.AspNetCore.Identity.UserManager`1[Microsoft.AspNetCore.Identity.Identity.IdentityUser]”的服务


我无法向该服务添加两个默认标识。我需要有关如何解决此问题的帮助

请检查是否在视图\Shared\u LoginPartial.cshtml中将
IdentityUser
更改为
ApplicationUser

@inject SignInManager<ApplicationUser> SignInManager
@inject UserManager<ApplicationUser> UserManager
@inject-SignInManager-SignInManager
@注入用户管理器用户管理器
@inject SignInManager<ApplicationUser> SignInManager
@inject UserManager<ApplicationUser> UserManager