ASP.NET Core的MVC项目自定义身份ApplicationUser

添加了自定义的ApplicationDbContext 和ApplicationUser ,并添加了Identity认证后,会出现

InvalidOperationException: Unable to resolve service for type 'Microsoft.AspNetCore.Identity.UserManager`1[Microsoft.AspNetCore.Identity.IdentityUser]' 错误

需要在解决方案中搜索IdentityUser,把相关网页上注入的IdentityUser改为ApplicationUser

posted @ 2020-08-08 11:47  XXXUJIA  阅读(87)  评论(0编辑  收藏