Package is not found in the following primary source

.NetAzure DevopsNuget Package

.Net Problem Overview


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.

.Net Solutions


Solution 1 - .Net

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.

Solution 2 - .Net

I waited another 5 minutes and the problem went away. Maybe the version shows before the publishing is complete.

Solution 3 - .Net

You have to check your package source I think the default is

Microsoft Visual Studio Offline Packages 

So, you can change that to "All".

package source

Solution 4 - .Net

After 4 hours struggle I found solution here https://www.grapecity.com/componentone/docs/uwp/online-getting-started/config-nugetpackage.html

Tools > Options > NuGet Package Manager > Package Sources. > Click add button and add following one by one...

nuget.org https://www.nuget.org/api/v2/

GrapeCity http://nuget.grapecity.com/nuget reference Image

Solution 5 - .Net

In my case I did not include the url from nuget.org in the Package Source. Therefore add the url from nuget.org in "Tools-> Options-> NuGet Package Manager-> Package Sources" and the whole thing started to work. for more details can visit this blog

Solution 6 - .Net

In my case there was a private network folderbased nuget repository listed in my sources. And at the moment it was not available. I unchecked it in "Tools->Options->NuGet Package Manager->Package Sources" and the whole thing started to work

Solution 7 - .Net

Restarting Visual Studio 2019 Community fixed the issue for me.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionKirstenView Question on Stackoverflow
Solution 1 - .NetnoriMonstaView Answer on Stackoverflow
Solution 2 - .NetKirstenView Answer on Stackoverflow
Solution 3 - .Net1392023093userView Answer on Stackoverflow
Solution 4 - .NetWaqas JavaidView Answer on Stackoverflow
Solution 5 - .NetAgungCode.ComView Answer on Stackoverflow
Solution 6 - .Netuser3088037View Answer on Stackoverflow
Solution 7 - .NetRMuesiView Answer on Stackoverflow