nuget restore causing build failures 50% of the time

Over the last few days, I've been getting consistent build failures during nuget restore. Most of my plans will build Debug and Releases configurations in parallel, which has been working very well for a while now until the last few day. Now I'm seeing results that will have Release complete bug debug fail, of vice versa. Here is a typical example of what i'm seeing in the build logs:

WARNING: Unable to connect to the remote server
WARNING: Unable to connect to the remote server
Unable to find version '2.1.0' of package 'Microsoft.Owin.Security'.
Unable to find version '2.1.0' of package 'Microsoft.Owin.Security.OAuth'.
Command exited with code 1

I'm using a standard restore command passing in the public feed and my own private feed hosted at myget...no issues until now.

nuget restore src/MySolution.sln -Source "https://www.nuget.org/api/v2;https://www.myget.org/F/myCustomFeed"
  1. Unfortunately, nuget.org hiccups are happening from time to time. I recommend setting up build cache for nuget packages to minimize that dependency: http://www.appveyor.com/docs/nuget#dealing-with-intermittent-nuget-...

  2. I swear I checked the docs first :) .perfect, thank you.

  3. Just a followup, I've added the recommended setting to my cache setting, however my sln resides in a src subdirectory...I've tried a few variations, but it seems it will still only look for a packages folder in the repo root. here is what I've tried with no luck:

    packages -> **\**\packages.config
    packages -> src\**\packages.config
    

    results in Cache entry not found: C:\projects\repo\packages

  4. Yeah, path is on the left and invalidation trigger (dependency) is on the right. If sln in src directory then try this:

    src\packages -> **\packages.config
    
  5. Is there a way to configure nuget build caches without using .yml files? We don't use them, we only use the GUI (and need to keep it that way really).

  6. @Richard Yes, i'm not using .yml...you can add this right in the interface on the Environment tab of your plan settings. You'll see Cached directories and files, just add one or more of the entries discussed above.

    @Feodor that worked, thank you!

  7. Hmm, that's interesting. Will that permanently cache though? What if the nuget packages in there are updated, will it handle that appropriately? Or will I need to do something whenever that happens?

  8. The cache is not guaranteed to be permanent. Packages of specific versions that already cached won't be changed - they are immutable on nuget.org. Also, cache will be invalidated (and thus packages re-fetched from nuget.org) when any of packages.config changes.

  9. chris closed this discussion on 31 Jul, 2015 07:18 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac