我尝试按照此处的说明操作:
https://code.google.com/p/google-api-dotnet-client/wiki/Build
但是当我尝试遵循“使用NuGet”下的说明时,我失败了!
我收到以下回复:
Attempting to resolve dependency 'Newtonsoft.Json (≥ 5.0.5)'.
Attempting to resolve dependency 'Microsoft.Bcl (≥ 1.0.19)'.
Attempting to resolve dependency 'Microsoft.Bcl.Build (≥ 1.0.4)'.
Attempting to resolve dependency 'Microsoft.Bcl.Async (≥ 1.0.16)'.
Attempting to resolve dependency 'Microsoft.Net.Http (≥ 2.1.10)'.
Attempting to resolve dependency 'Zlib.Portable (≥ 1.9.2)'.
Attempting to resolve dependency 'log4net (≥ 2.0.0)'.
Successfully installed 'Newtonsoft.Json 5.0.6'.
Successfully installed 'Microsoft.Bcl.Build 1.0.7'.
Successfully installed 'Microsoft.Bcl 1.0.19'.
Successfully installed 'Microsoft.Bcl.Async 1.0.16'.
Successfully installed 'Microsoft.Net.Http 2.1.10'.
Successfully installed 'Zlib.Portable 1.9.2'.
Successfully installed 'log4net 2.0.0'.
Successfully installed 'Google.Apis 1.4.0-beta'.
Successfully added 'Newtonsoft.Json 5.0.6' to JoBeGAPPSAdm.
Successfully added 'Microsoft.Bcl.Build 1.0.7' to JoBeGAPPSAdm.
Executing script file 'C:\Users\Swejope\documents\visual studio 2012\Projects\JoBeGAPPSAdm\packages\Microsoft.Bcl.Build.1.0.7\tools\Install.ps1'.
Successfully added 'Microsoft.Bcl 1.0.19' to JoBeGAPPSAdm.
Successfully added 'Microsoft.Bcl.Async 1.0.16' to JoBeGAPPSAdm.
Successfully added 'Microsoft.Net.Http 2.1.10' to JoBeGAPPSAdm.
Executing script file 'C:\Users\Swejope\documents\visual studio 2012\Projects\JoBeGAPPSAdm\packages\Microsoft.Bcl.Build.1.0.7\tools\Uninstall.ps1'.
Successfully uninstalled 'Zlib.Portable 1.9.2'.
Successfully uninstalled 'Microsoft.Net.Http 2.1.10'.
Successfully uninstalled 'Microsoft.Bcl.Async 1.0.16'.
Successfully uninstalled 'Microsoft.Bcl 1.0.19'.
Access to the path 'C:\Users\Swejope\documents\visual studio 2012\Projects\JoBeGAPPSAdm\packages\Microsoft.Bcl.Build.1.0.7\tools\Microsoft.Bcl.Build.Tasks.dll' is denied.
Katalogen är inte tom.
Successfully uninstalled 'Microsoft.Bcl.Build 1.0.7'.
Successfully uninstalled 'Newtonsoft.Json 5.0.6'.
Install failed. Rolling back...
Access to the path 'C:\Users\Swejope\documents\visual studi 2012\Projects\JoBeGAPPSAdm\packages\Microsoft.Bcl.Build.1.0.7\tools\Microsoft.Bcl.Build.Tasks.dll' is denied.
Katalogen är inte tom.
Could not install package 'Zlib.Portable 1.9.2'. 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 that are compatible with that framework. For more information, contact the package author.
我已经尝试使用.NETFramework 4.5,但响应相同。
编辑:我已经解决了这个问题!
在Visual Studio Express 2012中更新NuGet对此进行了整理。
答案 0 :(得分:3)
根据您提到的输出,您实际上遇到了另一个问题:
访问路径'C:\ Users \ Swejope \ documents \ visual studio 2012 \ Projects \ JoBeGAPPSAdm \ packages \ Microsoft.Bcl.Build.1.0.7 \ tools \ Microsoft.Bcl.Build.Tasks.dll'is拒绝。
首先检查一下,解决它(可能以管理员身份运行VS?),然后重试。