dotnet Initialization fails with multiple nuget sources
See original GitHub issueSteps to reproduce
I am running dotnet version 1.0.4. I have the following nuget configuration file in folder C:\Program Files (x86)\NuGet\Config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSource>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
<add key="syncfusion" value="http://nuget.syncfusion.com/aspnet" />
</packageSource>
<packageRestore>
<add key="enabled" value="True" />
<add key="automatic" value="True" />
</packageRestore>
<bindingRedirects>
<add key="skip" value="False" />
</bindingRedirects>
</configuration>
I am trying to install a new template, Fable.Template. I run the following command
dotnet new -i Fable.Template:😗
Expected behavior
I would expect the Fable.Template package to be downloaded from the first soure (nuget.org) and installed.
Actual behavior
nuget is ignoring the first source declared in the nuget.config file (the nuget source) and is attempting to download the packages from the second source (syncfusion).
I get the following error
Restoring packages for C:\Users\user.folder\.templateengine\dotnetcli\v1.0.4\scratch\restore.csproj… Retrying ‘FindPackagesByIdAsyncCore’ for source ‘http://nuget.syncfusion.com/aspnet/FindPackagesById()?id=‘Microsoft.NETCore.Targets’’. Response status code does not indicate success: 500 (Internal Server Error). Retrying ‘FindPackagesByIdAsyncCore’ for source ‘http://nuget.syncfusion.com/aspnet/FindPackagesById()?id=‘Fable.Template’’. Response status code does not indicate success: 500 (Internal Server Error). Retrying ‘FindPackagesByIdAsyncCore’ for source ‘http://nuget.syncfusion.com/aspnet/FindPackagesById()?id=‘Microsoft.NETCore.Targets’’. Response status code does not indicate success: 500 (Internal Server Error). Retrying ‘FindPackagesByIdAsyncCore’ for source ‘http://nuget.syncfusion.com/aspnet/FindPackagesById()?id=‘Fable.Template’’. Response status code does not indicate success: 500 (Internal Server Error). C:\Program Files\dotnet\sdk\1.0.4\NuGet.targets(97,5): error : Failed to retrieve information about ‘Fable.Template’ from remote source ‘http://nuget.syncfusion.com/aspnet/FindPackagesById()?id=‘Fable.Template’’.\r [C:\Users\user.folder.templateengine\dotnetcli\v1.0.4\scratch\restore.csproj] C:\Program Files\dotnet\sdk\1.0.4\NuGet.targets(97,5): error : Response status code does not indicate success: 500 (Internal Server Error). [C:\Users\user.folder.templateengine\dotnetcli\v1.0.4\scratch\restore.csproj]
Environment data
dotnet --info
output:
.NET Command Line Tools (1.0.4)
Product Information: Version: 1.0.4 Commit SHA-1 hash: af1e6684fd
Runtime Environment: OS Name: Windows OS Version: 10.0.14393 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\1.0.4
Issue Analytics
- State:
- Created 6 years ago
- Comments:16 (6 by maintainers)
Top GitHub Comments
why is this closed? I see also on Linux and mostly in Docker containers. It’s a simply description of sources, it shoud just work.
Only workaround I’ve found for now is to temporarily comment out the offending source and run the install.
Obviously the desired behaviour should be that if any feed fails it moves on and tries the others, as I shouldn’t need to specify the feed credentials unless I’m absolutely looking for a package in that feed.