更新时间:2023-02-16 14:07:16
我明白了原因.可能是您在应用程序中两次注册了Identity
,如下所示:
I got the reason. May be you are registering Identity
twice in your application as follows:
启动类的ConfigureServices
方法之一:
services.AddDefaultIdentity<IdentityUser>()
.AddDefaultUI(UIFramework.Bootstrap4)
.AddEntityFrameworkStores<ApplicationDbContext>();
以及IdentityHostingStartup
中的其他内容:
services.AddDefaultIdentity<IdentityUser>(config =>
{
config.SignIn.RequireConfirmedEmail = true;
}).AddEntityFrameworkStores<ApplicationDbContext>();
将Identity
注册在一个位置,即使用ConfigureServices
方法还是IdentityHostingStartup
.
Register Identity
just in one place i.e either in ConfigureServices
method or in IdentityHostingStartup
.
希望这会对您有所帮助.
Hope this will help you.