无法安装 NuGet 包:回退到 NuGet 本地缓存

use*_*241 5 c# nuget google-drive-api google-api-dotnet-client

我是堆栈溢出社区的新手。现在我正在学习 c#(使用 Visual Studio 2012)并致力于在谷歌驱动器中上传文件。

我按照本教程 http://www.daimto.com/google-drive-api-c-upload/ 但遗憾的是我在执行此命令时出错

安装包 Google.Apis.Drive.v2

源 [(Aggregate source)] 无法访问。回退到 C:\Users\Cyclone\AppData\Local\NuGet\Cache Install-Package 处的 NuGet 本地缓存:无法找到包“Google.Apis.Drive.v2”。在 line:1 char:1 + Install-Package Google.Apis.Drive.v2 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~ + CategoryInfo : NotSpecified: (:) [Install-Package], InvalidOperationException +fullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand

我真的不知道问题所在,无法继续我的项目。有人可以向我解释如何解决此错误或在 Google 驱动器中上传文件的任何解决方法。

谢谢你,抱歉英语不好!

Pet*_*ter 6

也许添加 -Source nuget.org到您的命令会解决这个问题?

所以试试这个命令:

Install-Package Google.Apis.Drive.v2 -Source nuget.org
Run Code Online (Sandbox Code Playgroud)

或者,您也可以尝试http://www.nuget.org/api/v2代替nuget.org

如果这有效,则您的包源可能配置错误。