使用 MS VS 2015 Pro 和 Asp.net Core,我尝试添加 Microsoft.AspNet.Identity.Core 包,但收到此错误:
Errors in c:\users\xxx\documents\visual studio 2015\Projects\WebApplication1\src\WebApplication1\WebApplication1.xproj
Package Microsoft.AspNet.Identity.Core 2.2.0 is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Package Microsoft.AspNet.Identity.Core 2.2.0 supports: net45 (.NETFramework,Version=v4.5)
One or more packages are incompatible with .NETCoreApp,Version=v1.0.
我还将软件包版本更改为2.1。但遇到同样的错误。为什么会出现这种情况?
Microsoft.AspNet.Identity.Core
是 ASP.NET 4(例如 MVC5)的旧包,不适用于 ASP.NET Core。
您需要
Microsoft.AspNetCore.Identity
ASP.NET Core 包。