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

在新建asp.net core 应用后, 添加了自定义的ApplicationDbContext 和ApplicationUser ,并添加了Identity认证后, 会出现 InvalidOperationException: Unable to resolve service for type 'Microsoft.AspNetCore.Identity.UserManager`1[Microsoft.AspNetCore.Identity.IdentityUser]' 错误。需要把相关网页上注入的UserManager<IdentityUser> 改为UserManager<ApplicationUser> .

上一篇:ASP.NET Core 入门笔记7,ASP.NET Core MVC 视图布局入门


下一篇:Visual Studio下使用jQuery的10个技巧