Google-api-dotnet-client: An error occurred while downloading package 'Newtonsoft.Json.10.0.2 :

Created on 20 Jun 2017  路  9Comments  路  Source: googleapis/google-api-dotnet-client

Visual studio 2015 - New Asp.net web application. framework 4.5.2 Its a brand new project nothing in it besides the stranded code VS adds to the project.

Import package Install-Package Google.Apis.AnalyticsReporting.v4 or Install-Package Google.Apis.AnalyticsReporting.v4 -Version 1.27.1.881

Results in error

PM> Install-Package Google.Apis.AnalyticsReporting.v4 -Version 1.27.1.881
Attempting to gather dependencies information for package 'Google.Apis.AnalyticsReporting.v4.1.27.1.881' with respect to project 'GoogleAuthWebTest', targeting '.NETFramework,Version=v4.5.2'
Attempting to resolve dependencies for package 'Google.Apis.AnalyticsReporting.v4.1.27.1.881' with DependencyBehavior 'Lowest'
Resolving actions to install package 'Google.Apis.AnalyticsReporting.v4.1.27.1.881'
Resolved actions to install package 'Google.Apis.AnalyticsReporting.v4.1.27.1.881'
Removed package 'Newtonsoft.Json.6.0.4' from 'packages.config'
Successfully uninstalled 'Newtonsoft.Json.6.0.4' from GoogleAuthWebTest
Install failed. Rolling back...
Package 'Newtonsoft.Json.10.0.2 : ' does not exist in project 'GoogleAuthWebTest'
Package 'Newtonsoft.Json.6.0.4' already exists in folder 'C:\Users\HP_User\documents\visual studio 2015\Projects\GoogleAuthWebTest\packages'
Added package 'Newtonsoft.Json.6.0.4' to 'packages.config'
Executing script file 'C:\Users\HP_User\documents\visual studio 2015\Projects\GoogleAuthWebTest\packages\Newtonsoft.Json.6.0.4tools\install.ps1'
Package 'Newtonsoft.Json.10.0.2 : ' does not exist in folder 'C:\Users\HP_User\documents\visual studio 2015\Projects\GoogleAuthWebTest\packages'
Install-Package : An error occurred while downloading package 'Newtonsoft.Json.10.0.2 : ' from source 'https://www.nuget.org/api/v2/'.
At line:1 char:1

Note: I can see it removing Json and then adding it again then it rolls everything back.

Update:

This one works Install-Package Google.Apis.AnalyticsReporting.v4 -Version 1.25.0.847 everything after that results in an error. Same thing on just a console application so it has nothing to do with the project type.

Most helpful comment

Found this elsewhere: "For anyone having this issue, the problem is with the URL https://www.nuget.org/api/v2/. Update your application to use https://api.nuget.org/v3/index.json instead and it will install properly".
https://github.com/JamesNK/Newtonsoft.Json/issues/1274

All 9 comments

Same here. Issue is with the Newtonsoft package. I'm unable to install, or update to, version 10.x.x. No problem with version 9.0.1

Which version of visual Studio are you using?

2015, same as you. But latest Newtonsoft "requires NuGet 2.12 or higher". Have to figure out which version of NuGet is running with this version of VS.

VS About box says NuGet Package Manager 3.3.0, so that should be good.

Found this elsewhere: "For anyone having this issue, the problem is with the URL https://www.nuget.org/api/v2/. Update your application to use https://api.nuget.org/v3/index.json instead and it will install properly".
https://github.com/JamesNK/Newtonsoft.Json/issues/1274

Wrong button! Let me check my installation

That worked. Thanks!

For those who are wondering how to change URL,
Refer this: https://docs.microsoft.com/en-us/nuget/tools/package-manager-ui#install-options

Mine is already https://api.nuget.org/v3/index.json but still can't get installed.

to Resolve this issue you need to Update Nuget Package Manger.
To update Nuget Package Manager Please Go to Tools => Updates and update Nuget Package Manger.

Was this page helpful?
0 / 5 - 0 ratings