Today I encountered an error while I was trying to add a reference for newtonSoft.JSON from the NuGet Package Manager of Visual Studio 2010. Initially, I struggled and attempted various ways to resolve this and finally succeeded in resolving this. Please use this approach to resolve such NuGet errors.
I encountered an error as given below:
Could not connect to the feed specified at "https://nuget.org/api/v2/"'. Please verify that the package source (located in the Package Manager Settings) is valid and ensure your network connectivity.
There are a few steps recommended to resolve an error as shown below:
Step 1
Open the file devnev.exe.config at C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE.
Step 2
Take a backup of this file for precautionary purposes.
Step 3
Open this file and find system <System.Net> </System.Net> that you may see at the bottom of this file.
Step 4
Add the following segment into <System.net> as shown below:
- <system.net>
- <settings>
- <servicePointManager expect100Continue="false" />
- <ipv6 enabled="true"/>
- </settings>
- <defaultProxy useDefaultCredentials="true" enabled="true">
- <proxy usesystemdefault="True"/>
- </defaultProxy>
- </system.net>
Step 5
Save and close this file.
Step 6
Reopen Visual Studio 2010.
Step 7
For finding the package, first we need to open the Package Manager Console. We can open it as in the following:
- From the Tools menu.
- Select "Library Package Manager".
- Then select "Manage NuGet Packages for Solution".
- Open the NuGet Package Manager and type your desire file name, for examle I specified NewtonSoft.Json.
As soon as you have succeeded in downloading, a welcome message page is shown as in the following:
I hope it will help to resolve your issue.
Thanks.