恢复 AspNet Identity Core 包时出错

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

使用 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。但遇到同样的错误。为什么会出现这种情况?

asp.net-core asp.net-identity asp.net-core-identity
1个回答
30
投票

Microsoft.AspNet.Identity.Core
是 ASP.NET 4(例如 MVC5)的旧包,不适用于 ASP.NET Core。

您需要

Microsoft.AspNetCore.Identity
ASP.NET Core 包。

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