无法安装软件包' Google.Apis.Core 1.13.1',无法卸载' Microsoft.Bcl.Build 1.0.21'

时间:2016-06-01 08:25:59

标签: .net-4.0 google-api google-calendar-api nuget-package google-api-dotnet-client

我对Google Calendar Api有疑问。当Install-Package Google.Apis.Calendar.v3正常工作时,无法安装Google.Apis和Google.Apis.Auth包。项目在.net 4.0。

Install-Package : Unable to uninstall 'Microsoft.Bcl.Build 1.0.21' because 'Microsoft.Bcl 1.1.10' depends on it.
At line:1 char:1
+ Install-Package Google.Apis
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], InvalidOperationException
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand


Install-Package : Could not install package 'Google.Apis.Core 1.13.1'. You are trying to install this package into a projec
t 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 Google.Apis.Auth
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], InvalidOperationException
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand


PM> Install-Package Google.Apis.Calendar.v3
'Google.Apis.Calendar.v3 1.13.1.509' already installed.

主要参考" Google.Apis.Calendar.v3,Version = 1.13.1.509,Culture = neutral,PublicKeyToken = 4b01fa6e34db77ab,processorArchitecture = MSIL"无法解决,因为它对框架程序集具有间接依赖性; System.Net.Http,Version = 1.5.0.0,Culture = neutral,PublicKeyToken = b03f5f7f11d50a3a"这在目前的目标框架中无法解决。 " .NETFramework,版本= 4.0版&#34 ;.要解决此问题,请删除引用" Google.Apis.Calendar.v3,Version = 1.13.1.509,Culture = neutral,PublicKeyToken = 4b01fa6e34db77ab,processorArchitecture = MSIL"或者将您的应用程序重新定位到包含" System.Net.Http,Version = 1.5.0.0,Culture = neutral,PublicKeyToken = b03f5f7f11d50a3a"。

的框架版本。

1 个答案:

答案 0 :(得分:2)

将您的项目升级到.Net framework 4.5,它应该可以运行。错误消息可以准确地告诉您问题所在。

  

无法安装软件包' Google.Apis.Core 1.13.1'。你正试图   将此包安装到目标项目中   ' .NETFramework,Version = v4.0',但包不包含任何   兼容的程序集引用或内容文件   的框架

如果您查看NuGet页面Google APIs Core Client Library 1.13.1

  

Google API核心库包含Google API HTTP层JSON   支持,数据存储,日志记录等。

     

支持的平台:

     
      
  • .NET Framework 4.5
  •   
  • Windows应用商店应用
  •   
  • Windows Phone 8和8.1
  •   
  • 便携式类库
  •   

您必须返回1.10才能找到支持Framework 4.0的版本

GitHub

上的Google .Net客户端库的主页