【发布时间】:2020-05-22 18:48:42
【问题描述】:
我创建了一个没有身份的 .NET Core 项目,然后尝试从脚手架添加身份。我的启动代码是:
public System.IServiceProvider ConfigureServices(IServiceCollection services)
{
services.AddDbContext<ProjectDbContext>(options =>
options.UseSqlServer(
Configuration.GetConnectionString("DefaultConnection")));
services.AddDefaultIdentity<Microsoft.AspNetCore.Identity.IdentityUser>(options => options.SignIn.RequireConfirmedAccount = true)
.AddEntityFrameworkStores<ProjectDbContext>();
...
}
但是在调用身份表单时它不起作用,并且标头 URL 是:
http://localhost:5000/?area=Identity&page=%2FAccount%2FLogin
我错过了什么?
【问题讨论】:
-
如果链接的解决方案无法解决此问题,请联系我,但应该解决。
标签: c# asp.net-core asp.net-identity