question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

dotnet Initialization fails with multiple nuget sources

See original GitHub issue

Steps 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:closed
  • Created 6 years ago
  • Comments:16 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
VGerriscommented, Jun 29, 2020

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.

1reaction
ckpearsoncommented, Apr 11, 2018

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Installing NuGet package with dependencies on multiple ...
It appears that it's impossible to specify multiple sources using the Package Manage Console (PowerShell). However, if no -Source is specified ...
Read more >
Multi-targeting for NuGet Packages
If the project targets .NET framework 4.0 and earlier, NuGet throws an appropriate error message for not finding the compatible assembly.
Read more >
Authorize and Restore Azure Artifacts NuGet Packages in ...
It will first try to use the NuGet.config in the current working directory first; Next, it will use the local user NuGet.config in...
Read more >
Rider keeps my prompting for my credentials in private ...
Hi, we using a lot of internal nuget feeds out of azure devops in ... Windows Integrated Authentication' failed with exception:\nMicrosoft.
Read more >
Professional C# and .NET - Google Books Result
NET Standard Creating NuGet packages Supporting multiple platforms with NuGet packages CODE DOWNLOADS FOR THIS CHAPTER The source code for this chapter is ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found