87

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.

7 Answers 7

205

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.

3
  • 4
    For those who dont want to wait, this is the fix. Dec 13, 2019 at 5:05
  • I don't understand why are they even caching because it definitely isn't working since it takes 10-15 seconds anyway for that error to appear
    – Sasino
    Jan 6 at 21:35
  • 1
    Worked for me. Why is Nuget so full of these idiosyncracies and gotchas? Apr 3 at 13:28
36

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

5
  • 5
    Just had the same time delay on our private NuGet feed hosted on Azure DevOps. Took 10 minutes for the package to show up.
    – tomRedox
    Apr 25, 2019 at 16:41
  • 7
    INDEED! THIS IS A REALLY OBNOXIOUS THING! The OP states they can see the updated version in their 'Package Manager Console' - but I think they mean the 'Nuget Package Manager' browsing UI. I too can see my updated package listed there but then when I attempt to run the Install-Package command it fails.
    – bkwdesign
    Jun 3, 2019 at 16:09
  • Thanks, It has been a while since this bothered me, but I think you must be right. I corrected the question. ( What does OP stand for? )
    – Kirsten
    Jun 3, 2019 at 21:53
  • 3
    I'm afraid that 5 min is very optimistic. I've uploaded the package 8 minutes ago using release pipeline but it is still invisible by the VS. The strange thing is that https://pkgs.dev.azure.com/orgid/_packaging/feedguid/nuget/v3/query2/ show correct version for my package. Do you know how can I adjust the time required to refresh the package ?
    – oleksa
    Feb 5, 2020 at 16:23
  • 2
    @Kirsten: OP stands for Original Poster
    – jmoreno
    Dec 2, 2022 at 1:34
8

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

1
  • 1
    Nuget online repo link was missing. Thank you!
    – SiL3NC3
    Mar 4, 2022 at 22:00
6

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

1

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

0

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

-2

Restarting Visual Studio 2019 Community fixed the issue for me.

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.