无法安装NuGet包Microsoft.AspNet.Identity.Core。

5

我无法安装nuget包。

Microsoft.AspNet.Identity.Core.

当我运行“install-package”命令时,收到以下信息。它表示我尝试将该软件包安装到 .NET 4 项目中,但该软件包不参考那个版本。使用VS2010 .NET v4。

预先感谢您。

下面是PM>文本:

PM> Install-Package Microsoft.AspNet.Identity.Core Installing 'Microsoft.AspNet.Identity.Core 2.1.0'. You are downloading Microsoft.AspNet.Identity.Core from Microsoft, the license agreement to which is available at http://www.microsoft.com/web/webpi/eula/net_library_eula_ENU.htm. Check the package for additional dependencies, which may come with their own license agreement(s). Your use of the package and dependencies constitutes your acceptance of their license agreements. If you do not accept the license agreement(s), then delete the relevant components from your device. Successfully installed 'Microsoft.AspNet.Identity.Core 2.1.0'. Adding 'Microsoft.AspNet.Identity.Core 2.1.0' to PracticeMvcApplication. Uninstalling 'Microsoft.AspNet.Identity.Core 2.1.0'. Successfully uninstalled 'Microsoft.AspNet.Identity.Core 2.1.0'. Install failed. Rolling back... Install-Package : Could not install package 'Microsoft.AspNet.Identity.Core 2.1.0'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.0', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.


7
我相信Asp.net Identity是.NET 4.5.1的一部分,我不认为它可以在以.NET 4.0为目标的项目中使用。 - Claies
安德鲁是正确的,错误信息恰好告诉了你这一点。 - DavidG
1个回答

6

安德鲁是正确的,你无法在目标为 .Net 4 或更低版本的项目上安装 Identity。


你是不是想说的是4.5.1而不是更低的版本? - trailmax
1
因此,我们无法在Visual Studio 2010或更低版本中使用ASP.NET身份验证。感谢大家的帮助。 - Catto

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接