NuGet Package Manager error: The remote name could not be resolved

27,714

Solution 1

I had to add a new package source using the following location:

http://packages.nuget.org

Click on settings in the package manager to manage the sources.

Solution 2

D'oh!... In my case, I had no internet connection on the computer. The DNS IP address was missing. So make sure you can access the internet from the computer you're trying to install the NuGet package. This is important to check specially if you're working in a Virtual Machine like I'm right now. :)

It failed with this message:

PM> Install-Package jQuery -Version 1.10.2
Install-Package : The remote name could not be resolved: 'nuget.org'
At line:1 char:1
+ Install-Package jQuery -Version 1.10.2
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], WebException
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand

So the could not be resolved has to do with no internet connection.

Solution 3

ipconfig /flushdns at the command prompt fixed it for me.

Share:
27,714

Related videos on Youtube

Asdfg
Author by

Asdfg

Always trying to do the hard thing. Not necessarily the hard way.

Updated on July 09, 2022

Comments

  • Asdfg
    Asdfg almost 2 years

    I am using version 1.4 and getting this error:

    The remote name could not be resolved: go.microsoft.com
    

    Here are the URLs for the nuget package:

    https://go.microsoft.com/fwlink/?LinkID=206669
    

    Am i missing something here? It was working fine couple of weeks earlier.

  • Tiramonium
    Tiramonium over 4 years
    "Why my Hyper-V VM using a network adaptor with only internal access can't reach nuget?" Lol