Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specifying `dotnet add package --source` fails on another unreachable source #7999

Open
kcd83 opened this Issue Apr 14, 2019 · 0 comments

Comments

Projects
None yet
1 participant
@kcd83
Copy link

kcd83 commented Apr 14, 2019

dotnet.exe fails to add a package when specifying source one when source two is unavailable.

Reproduction

  1. Check sources nuget source list, (one is not available)

  2. Use dotnet cli to add package from a source

dotnet add package --source https://www.nuget.org/api/v2/ Figgle

Fails, because of another source. Expected it to be ignored, only the supplied source should be used.

Workaround

Disable the problematic source

nuget source disable -name 'MyCompany NuGet Server'
dotnet add package --source https://www.nuget.org/api/v2/ Figgle

Verbose Logs

C:\Data\gitlab\kcd\dotnet-cli-test> dotnet add package --source https://www.nuget.org/api/v2/ Figgle
  Writing C:\Users\kdyer\AppData\Local\Temp\tmpA6D3.tmp
info : Adding PackageReference for package 'Figgle' into project 'C:\Data\gitlab\kcd\dotnet-cli-test\dotnet-cli-test.csproj'.
log  : Persisting no-op dg to C:\Data\gitlab\kcd\dotnet-cli-test\obj\dotnet-cli-test.csproj.nuget.dgspec.json
info : Restoring packages for C:\Data\gitlab\kcd\dotnet-cli-test\dotnet-cli-test.csproj...
info :   GET https://nuget.mycompany.local/FindPackagesById()?id='Figgle'&semVerLevel=2.0.0
info :   GET https://www.nuget.org/api/v2/FindPackagesById()?id='Figgle'&semVerLevel=2.0.0
log  : Retrying 'FindPackagesByIdAsyncCore' for source 'https://nuget.mycompany.local/FindPackagesById()?id='Figgle'&semVerLevel=2.0.0'.
log  : No such host is known.
info :   GET https://nuget.mycompany.local/FindPackagesById()?id='Figgle'&semVerLevel=2.0.0
log  : Retrying 'FindPackagesByIdAsyncCore' for source 'https://nuget.mycompany.local/FindPackagesById()?id='Figgle'&semVerLevel=2.0.0'.
log  : No such host is known.
info :   GET https://nuget.mycompany.local/FindPackagesById()?id='Figgle'&semVerLevel=2.0.0
error: Failed to retrieve information about 'Figgle' from remote source 'https://nuget.mycompany.local/FindPackagesById()?id='Figgle'&semVerLevel=2.0.0'.
error:   No such host is known.

Versions


dotnet --info
.NET Core SDK (reflecting any global.json):
 Version:   3.0.100-preview3-010431
 Commit:    d72abce213

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.16299
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\3.0.100-preview3-010431\

Host (useful for support):
  Version: 3.0.0-preview3-27503-5
  Commit:  3844df9537

.NET Core SDKs installed:
  1.0.4 [C:\Program Files\dotnet\sdk]
  3.0.100-preview3-010431 [C:\Program Files\dotnet\sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.App 3.0.0-preview3-19153-02 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 1.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 1.1.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.0.0-preview3-27503-5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 3.0.0-preview3-27504-2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

To install additional .NET Core runtimes or SDKs:
  https://aka.ms/dotnet-download
  
  
nuget
NuGet Version: 4.9.3.5777

I understand dotnet add package is maintained by this team?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.