1

I am trying to use the nuget restore command to restore NuGet packages on a CI server. I can run it locally without issue, but on the server I am getting a number of warnings (errors, really):

WARNING: The remote name could not be resolved: 'www.nuget'
WARNING: The remote name could not be resolved: 'www.nuget'
WARNING: The remote name could not be resolved: 'www.nuget'
WARNING: The remote name could not be resolved: 'www.nuget'
WARNING: The remote name could not be resolved: 'www.nuget'
WARNING: The remote name could not be resolved: 'www.nuget'
WARNING: The remote name could not be resolved: 'www.nuget'
Installing 'NSubstitute 1.8.1.0'.
Successfully installed 'NSubstitute 1.8.1.0'.
WARNING: The remote name could not be resolved: 'www.nuget'
WARNING: The remote name could not be resolved: 'www.nuget'
Unable to find version '1.7' of package 'DotSpatial.Data'.
Unable to find version '1.7' of package 'DotSpatial.Mono'.
Unable to find version '1.7' of package 'DotSpatial.Projections'.
Unable to find version '1.7' of package 'DotSpatial.Serialization'.
Unable to find version '1.7' of package 'DotSpatial.Topology'.
Unable to find version '9.1.1' of package 'JetBrains.Annotations'.
Unable to find version '1.0.0' of package 'SimpleLogger'.
Unable to find version '3.5.1' of package 'YamlDotNet'.
Unable to find version '2.0.0' of package 'NUnitTestAdapter.WithFramework'.

From what I can find (similar issues linked below), unable to resolve is a DNS issue. The NuGet status page shows DNS as working and the fact that I can run it locally without issue seems to indicate that it is not a NuGet server issue. I am using the command-line utility downloaded directly from the NuGet website in both locations. I have checked to ensure that there are no proxy-related environment variables interfering with the process. I am using Windows 7 in both locations. What could be the issue here?

Similar issues:

Community
  • 1
  • 1
Whymarrh
  • 13,139
  • 14
  • 57
  • 108

1 Answers1

1

The www.nuget part is the issue—that is not the correct remote (not the full remote name at least). This is most likely a configuration issue with your system and somewhere that name is stored incorrectly. Check your %AppData%\NuGet\ directory for a configuration file and ensure that it has the correct remote name everywhere.

What I had in %AppData%\NuGet\NuGet.config:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <add key="https://www.nuget.org/api/v2/" value="https://www.nuget.org/api/v2/" />
    <add key="NuGetHttp" value="http://www.nuget/api/v2/" />
  </packageSources>
  <disabledPackageSources>
    <add key="https://www.nuget.org/api/v2/" value="true" />
  </disabledPackageSources>
</configuration>

This line in particular is incorrect:

<add key="NuGetHttp" value="http://www.nuget/api/v2/" />

Fix the value in the line above and you should be good to go.

What I have now:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <add key="https://www.nuget.org/api/v2/" value="https://www.nuget.org/api/v2/" />
    <add key="NuGetHttp" value="http://www.nuget.org/api/v2/" />
  </packageSources>
  <disabledPackageSources>
    <add key="https://www.nuget.org/api/v2/" value="true" />
  </disabledPackageSources>
</configuration>

And running nuget restore works:

Installing 'DotSpatial.Mono 1.7'.
Installing 'DotSpatial.Serialization 1.7'.
Installing 'DotSpatial.Data 1.7'.
Installing 'DotSpatial.Projections 1.7'.
Successfully installed 'DotSpatial.Mono 1.7'.
Installing 'DotSpatial.Topology 1.7'.
Successfully installed 'DotSpatial.Data 1.7'.
Installing 'JetBrains.Annotations 9.1.1'.
Successfully installed 'DotSpatial.Topology 1.7'.
Installing 'SimpleLogger 1.0.0'.
Successfully installed 'JetBrains.Annotations 9.1.1'.
Successfully installed 'SimpleLogger 1.0.0'.
Successfully installed 'DotSpatial.Serialization 1.7'.
Installing 'YamlDotNet 3.5.1'.
Installing 'NSubstitute 1.8.1.0'.
Installing 'NUnitTestAdapter.WithFramework 2.0.0'.
Successfully installed 'NUnitTestAdapter.WithFramework 2.0.0'.
Successfully installed 'YamlDotNet 3.5.1'.
Successfully installed 'NSubstitute 1.8.1.0'.
Successfully installed 'DotSpatial.Projections 1.7'.
Whymarrh
  • 13,139
  • 14
  • 57
  • 108