Nuget source feed order

Hi there,

Is it possible to specify the order of the nuget feed to use during a job? e.g. we would like AV to search for packages FIRST on the account_feed and if the package is not available there, THEN to use nuget.org.

The reason for this weird requirement is that we are using a licensed 3rd party component. The vendor only provides a dll on nuget that expires after 45 days of usage. We would like to create a package with the same version on our account feed that would contain the licensed dll. We would only use this dll to build our setups on AV and this package should only be available to people with access to the account_feed

Thanks for letting me know if this is possible and if yes, how to set it up.

Bests,
Michael

  1. Hi Michael,

    You can try re-adding nuget.org source like this (I'm still not sure in what order nuget.exe checks the feeds, but presume it's the same order as displayed by nuget sources list command):

    nuget sources remove -name nuget.org
    nuget sources add -name nuget.org -source https://www.nuget.org/api/v2
    
  2. Hi Feodor,

    I have finally managed to try this solution but this does not work as expected. It seems that nuget.org is not removed.

    Here is what I tried

    1: Remove source with nuget.org and add it again at then end
    https://ci.appveyor.com/project/open-systems-pharmacology-ci/mobi/build/7.1.0.14

    I get the following error
    nuget sources add -name nuget.org -source https://www.nuget.org/api/v2
    The name specified has already been added to the list of available package sources. Please provide a unique name.

    So even though it was removed, it is still available

    2: I tried to remove the nuget feed and add it under another name. Packages in nuget are picked up first
    https://ci.appveyor.com/project/open-systems-pharmacology-ci/mobi/build/7.1.0.15

    3: I also tried to remove nuget.org and did not add it back.
    Packages from nuget.org are also used!!

    Here is what I can see in the console
    NuGet Config files used:
        C:\Users\appveyor\AppData\Roaming\NuGet\NuGet.Config
        C:\ProgramData\nuget\Config\Microsoft.VisualStudio.Offline.config
        C:\ProgramData\nuget\Config\ServiceFabricSDK.config
    Feeds used:
        C:\Users\appveyor\.nuget\packages\
        https://api.nuget.org/v3/index.json
        https://ci.appveyor.com/nuget/ospsuite-bddhelper
        https://ci.appveyor.com/nuget/ospsuite-utility
        https://ci.appveyor.com/nuget/ospsuite-serializer
        https://ci.appveyor.com/nuget/ospsuite-texreporting
        https://ci.appveyor.com/nuget/ospsuite-databinding
        https://ci.appveyor.com/nuget/ospsuite-databinding-devexpress
        https://ci.appveyor.com/nuget/ospsuite-funcparser
        https://ci.appveyor.com/nuget/ospsuite-simmodel
        https://ci.appveyor.com/nuget/ospsuite-simmodel-solver-cvodes-282
        https://ci.appveyor.com/nuget/ospsuite-core
        https://ci.appveyor.com/nuget/ospsuite-smartxls
        C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\
        C:\Program Files\Microsoft SDKs\Service Fabric\packages\

    Interestingly, the feed
    C:\Users\appveyor\.nuget\packages\
     https://api.nuget.org/v3/index.json

    are used even though they do not appear in the sources list.

    Is there a way to override that behavior?

    Thanks for your help,

    Bests,
    Michael

  3. Hey Feodor,

    You know what, after much consideration, we are just going to swap out the component per scripts. This is going to be much easier

    Thanks for your help on that,
    Mike

  4. Ah, OK then, thanks for keeping us updated!

  5. Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 02:16 AM.

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

Recent Discussions