Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot add or update NuGet packages, receiving NuGet V2 feed error

I have recently moved to VS 2019 and now I can not install or update packages through NuGet. I receive the following error -

An error occurred while retrieving package metadata for 'jQuery.3.4.1' from source 'NuGet.org'.
Failed to fetch results from V2 feed at 'https://www.nuget.org/FindPackagesById()?id='jQuery'&semVerLevel=2.0.0' with following message : Response status code does not indicate success: 404 (Not Found).
Response status code does not indicate success: 404 (Not Found).

I have NuGet Package source pointing to --- https://api.nuget.org/v3/index.json

Is there another package source I should be using?

like image 349
Ethel Patrick Avatar asked Jan 23 '20 16:01

Ethel Patrick


People also ask

How do I add a NuGet package to a feed?

Set up Visual StudioSelect NuGet Package Manager, and then select Package Sources. Enter the feed's Name and Source URL, and then select the green (+) sign to add a new package source. If you enabled upstream sources in your feed, clear the nuget.org checkbox. Select OK when you are done.

How do I force a NuGet package to install?

Switch to the Browse tab, search for the package name, select it, then select Install). For all packages, delete the package folder, then run nuget install . For a single package, delete the package folder and use nuget install <id> to reinstall the same one.

How do I update my NuGet package?

Alternatively, from Visual Studio right click on the References node in the Solution Explorer and select Add Library Reference (or select the same directly from the Tools menu). Select Updates from the left side. A list of updates will appear. Click Update.

How do I enable manage NuGet packages in Visual Studio?

In Solution Explorer, right-click References and choose Manage NuGet Packages. If you want more information on the NuGet Package Manager, see Install and manage packages using Visual Studio. Accept any license prompts. If prompted to review changes, select OK.


1 Answers

If you meet this issue in VS IDE:

Go Tools=>Nuget Package Manager=>Package Manager Settings=>Package Source to check if you have other package source whose URL is https://www.nuget.org, if it exists, disable/delete this package source.

If you meet this issue in command line:

enter image description here

You need to specify the source like this: nuget install PackageName -Source https://api.nuget.org/v3/index.json -Version 3.4.1. You may use other install command(dotnet other what), just make sure you specify the correct source in command.

Hope it helps to give a correct direction to resolve the issue :)

like image 123
LoLance Avatar answered Nov 05 '22 17:11

LoLance