4

When we push a new version of a NuGet package to our NuGet feed the package will appear in the file system on the NuGet server. The NuGet feed API and in visual studio, however only update roughly every hour so we may have to wait up to an hour for new packages to show. Is there a way to force update the NuGet feed to accurately depict what is in the file system?

Danny Varod
  • 17,324
  • 5
  • 69
  • 111
Adamon
  • 484
  • 9
  • 21
  • If it helps, we push to the nuget feed using teamcity. If there is a way to update the feed as part of nuget publish in teamcity that would also be great. – Adamon Aug 11 '16 at 08:56
  • I create a custom NuGet Feed on my machine and no matter I add the NuGet packages on a local feed or a website feed, after I add the package source in my Visual Studio, I can get the packages on NuGet Feed immediately. You can try push the package to local machine, whether it also has the same problem on local machine? If possible, please provide the detailed steps about how you push your package to NuGet Server. – Jack Zhai Aug 12 '16 at 02:34
  • Which type of the NuGet Server do you use? Web-based or File Shared? – Jack Zhai Aug 12 '16 at 07:21

1 Answers1

7

I've encountered very similar issue, after publishing new package version to private TeamCity NuGet feed it hasn't appeared in visual studio immediately. It took time to update.

However, new package version itself was available via request:

http://<teamcityserver>/guestAuth/app/nuget/v1/FeedService.svc/Packages(Id='<packageId>',Version='<newPackageVersion>')

For example:

http://test:8111/guestAuth/app/nuget/v1/FeedService.svc/Packages(Id='TestPackage',Version='1.0.1')

I resolved it by cleaning local NuGet cache via

Tools → Options →  NuGet Package Manager → General → Clear all NuGet cache(s)

or

dotnet nuget locals all --clear

See related answer:

https://stackoverflow.com/a/42665980/2793919

Sergey Nikitin
  • 845
  • 2
  • 13
  • 25