6

I am new in the stack overflow community. Right now I am learning c#(using visual studio 2012) and working on uploading files in a google drive.

I followed this tutorial http://www.daimto.com/google-drive-api-c-upload/ but sadly I have getting error when executing this command

Install-Package Google.Apis.Drive.v2

The source at All [(Aggregate source)] is unreachable. Falling back to NuGet Local Cache at C:\Users\Cyclone\AppData\Local\NuGet\Cache Install-Package : Unable to find package 'Google.Apis.Drive.v2'. At line:1 char:1 + Install-Package Google.Apis.Drive.v2 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Install-Package], InvalidOperationException + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand

I don't really know the problem and can't continue on my project. Could someone explain me how to solve this error or any work around in uploading files in a google drive.

Thank you and sorry for the bad English!

Linda Lawton - DaImTo
  • 106,405
  • 32
  • 180
  • 449
user3928241
  • 135
  • 2
  • 10
  • 5
    First answer in Google when searching for **Install-Package Google.Apis.Drive.v2 ERROR The source at All [(Aggregate source)] is unreachable** is [this](http://stackoverflow.com/questions/24025409/source-unreachable-when-using-the-nuget-package-manager-console) – Mong Zhu Jul 07 '16 at 09:58
  • Thank you for the help This do the trick http://stackoverflow.com/questions/24025409/source-unreachable-when-using-the-nuget-package-manager-console – user3928241 Jul 07 '16 at 10:07
  • BTW Drive v3 is out now but I don't have a tutorial for that. – Linda Lawton - DaImTo Jul 07 '16 at 10:56

2 Answers2

6

Maybe adding -Source nuget.org to your command would fix this?

So try the command:

Install-Package Google.Apis.Drive.v2 -Source nuget.org

Or, you can also try http://www.nuget.org/api/v2 instead of nuget.org

If this works, you may have your Package Source misconfigured.

Peter
  • 169
  • 1
  • 12
  • I am having Invalid URI error **Install-Package : Invalid URI: The format of the URI could not be determined. At line:1 char:1 + Install-Package Google.Apis.Drive.v2 -Source nuget.org + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Install-Package], UriFormatException + FullyQualifiedErrorId : System.UriFormatException,NuGet.PowerShell.Commands.InstallPackageCommand** – user3928241 Jul 07 '16 at 09:58
  • Sometimes microsoft visual studio doesn't like -Source. Try without it if you still get errors. Thanks a lot @Peter – Hbksagar Sep 14 '17 at 07:43
0

Please try to open user visual studio with admin rights and the project should be using at least .net version 4.0. You can also download sample project from github.

Note: I have tried Nuget install package command and it works. Install-Package Google.Apis.Drive.v2 works

Shantu
  • 145
  • 11