dotnet restore only tries one source

Created on 6 Mar 2017  路  8Comments  路  Source: microsoft/dotnet

位 dotnet --version
1.0.0-rc4-004771

When using dotnet restore with either a nuget.config with multiple sources, or passing multiple -s options it only tries one source.

This means that when trying to do dotnet restore on a project that has a private repo and a public repo and pulls from both, the restore operation will fail because obviously some package disparity between the two repos will exist.

Results from running:
位 dotnet restore
Restoring packages for C:\Project\example.csproj...
Retrying 'FindPackagesByIdAsyncCore' for source 'https://privaterepo.com/FindPackagesById()?id='YamlDotNet.Signed''.
Response status code does not indicate success: 404 (Not Found).
Retrying 'FindPackagesByIdAsyncCore' for source 'https://privaterepo.com/FindPackagesById()?id='WebSocketSharp''.
Response status code does not indicate success: 404 (Not Found).
Retrying 'FindPackagesByIdAsyncCore' for source 'https://privaterepo.com/FindPackagesById()?id='EntityFramework.CodeFirstStoreFunctions''. `

Most helpful comment

Hi all. Just wondering what the plan is with this? Our team just realised today they were running into this when trying to diagnose why restore was trying to pull public packages from the internal NuGet repo.

My concern here is that this was first opened in March and there has been radio silence since the last post in April. If this is being tracked somewhere else that's cool, but it'd be good to know if this is on anyones radar or we have to try and wade in and fix it ourselves.

Thanks!

All 8 comments

Are you saying that restore fails on the first source and doesn't try the second one?

/cc @blackdwarf

Yes essentially, it tries to restore the private package's dependencies only from the private repo, and never tries to look in the public one even though both are specified in the config file.

I was able to work around it kind of by running dotnet restore first with only the private repo as a source, then again with the public repo as a source. This got everything installed/cached but it generates at least one error each time.

@keslerm can you paste in your nuget.config? Also if you are using -s option can you provide the full invocation?

@blackdwarf I have tried every variation i could. Using the switches or the config file. Ultimately what ends up happening is the first provided source is the only source tried.

The project I am doing dotnet restore only has the one dependency which is hosted on the private repo. That privately hosted dependency has more dependencies that are available on the public repo.

The same thing happens if i use multiple source flags, the first one is the only repository tried

dotnet restore -s https://private.repo/ -s https://api.nuget.org/v3/index.json

Here is the NuGet.config file

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <packageSources>
        <add key=Private Repo" value="https://private-repo.com/" />
        <add key=Public Repo" value="https://api.nuget.org/v3/index.json" />
    </packageSources>
</configuration>

/cc @rrelyea @livarcocc

Hi all. Just wondering what the plan is with this? Our team just realised today they were running into this when trying to diagnose why restore was trying to pull public packages from the internal NuGet repo.

My concern here is that this was first opened in March and there has been radio silence since the last post in April. If this is being tracked somewhere else that's cool, but it'd be good to know if this is on anyones radar or we have to try and wade in and fix it ourselves.

Thanks!

Moving the issue to the NuGet repo.

This issue was moved to NuGet/Home#6140

Was this page helpful?
0 / 5 - 0 ratings