Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Package is not found in the following primary source

I have a build pipeline set up to create Nuget packages and publish them to a feed in artifacts.

I was able to use the feed successfully.

However when I ran the pipeline again, causing the packages to publish again I am not able to update the consuming project successfully.

Even though I can see the correct new version number in the Package Manager (Visual Studio -> Tools-> Nuget Package Manager -> Manage Nuget Packages for solution)

When I click install I get an error

Package '<mypackagename with version number>' is not found in the following primary source  <correct feed nuget/v3/index.json> Please verify all your online package sources are available (OR) package id, version are specified correctly. 
like image 496
Kirsten Avatar asked Feb 17 '19 23:02

Kirsten


People also ask

How do I add package sources?

Package sources To add a source, select +, edit the name, enter the URL or path in the Source control, and select Update. The source now appears in the selector drop-down. To change a package source, select it, make edits in the Name and Source boxes, and select Update.

How do I add package sources in Visual Studio?

Set up Visual StudioIn Visual Studio, select Tools, and then select Options. Select 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.

How do I add a missing package in Visual Studio?

Restore packages manually using Visual StudioEnable package restore by choosing Tools > Options > NuGet Package Manager. Under Package Restore options, select Allow NuGet to download missing packages. In Solution Explorer, right click the solution and select Restore NuGet Packages.

Where can I find NuGet package source?

From the Tools menu, select NuGet Package Manager | Package Manager Settings. The Options dialog box appears. In the left pane, select Package Sources.


1 Answers

This is caused by caching. If you don't want to wait like the above answer suggested, just clear Nuget caches by going to Tools -> Options -> Nuget -> General and click on the "Clear All Nuget Cache(s)" button.

like image 111
noriMonsta Avatar answered Sep 22 '22 08:09

noriMonsta