【问题标题】:Install multiple NuGet packages error安装多个 NuGet 包错误
【发布时间】:2017-12-06 16:09:58
【问题描述】:

我有这个问题。我想下载“Install-Package Microsoft.ProjectOxford.Face -Version 1.3.0”,但我遇到了这个错误。我搜索了,但我找不到。

Install-Package : Could not install package 'Microsoft.ProjectOxford.Common 1.0.324'. You are trying to install this package into a p
roject 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.
At line:1 char:1
+ Install-Package Microsoft.ProjectOxford.Face -Version 1.3.0
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand

【问题讨论】:

  • ` 依赖项:.NETStandard,Version=v1.1`
  • 该消息准确地显示了问题所在。您有一个针对 .net framework 4.0 的应用程序,但该库需要 .net 4.5。所以将你的项目升级到 4.5

标签: c# visual-studio nuget nuget-package


【解决方案1】:

安装多个 NuGet 包错误

首先要指出的是,magicandre cmets 指出了正确的方向,“将您的项目升级到 4.5”。

详细信息:

在nuget.org上搜索nuget包Microsoft.ProjectOxford.Face,我们注意到这个包有两个依赖:Microsoft.ProjectOxford.Common (>= 1.0.324)和Newtonsoft.Json (>= 9.0.1):

然后从nuget.org手动下载依赖包Microsoft.ProjectOxford.Common (>= 1.0.324),重命名为.zip结尾,然后解压。您会注意到该软件包针对 .NET Standard 1.1。

然后根据compatibility list of .NET Standard:

所以要安装包 Microsoft.ProjectOxford.Face,您应该将您的项目升级到 .NET 框架 4.5。

【讨论】:

    猜你喜欢
    • 2017-05-24
    • 1970-01-01
    • 1970-01-01
    • 2012-04-03
    • 2016-03-19
    • 1970-01-01
    • 2021-06-21
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多