Aspnetcore.Identity.EntityFramework 6.0.9,SignInManager 不起作用

问题描述 投票:0回答:1

我正在使用 Microsoft.AspNetCore.Identity.EntityFrameworkCore 6.0.9 Nuget 包,无法使用 SignInManager 方法。 此方法是否已被其他方法取代,或者我在某个时候犯了错误?

我在Program cs中添加了这段代码

builder.Services.AddIdentity<AppUser, AppRole>().AddEntityFrameworkStores<AppDbContext>();

SignInManager 要求我安装 AspNetCore.Identity,而 UserManager 则使用我安装的 nuget 包

asp.net-web-api asp.net-identity
1个回答
0
投票

我有同样的问题。您可以在控制器(api 和 mvc)中使用signInManager。

© www.soinside.com 2019 - 2024. All rights reserved.