简体   繁体   English

NuGet Package 管理器错误:无法解析远程名称

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

I am using version 1.4 and getting this error:我正在使用 1.4 版并收到此错误:

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

Here are the URLs for the nuget package:以下是 nuget package 的网址:

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

Am i missing something here?我在这里错过了什么吗? It was working fine couple of weeks earlier.几周前它运行良好。

I had to add a new package source using the following location: 我必须使用以下位置添加新的包源:

http://packages.nuget.org http://packages.nuget.org

Click on settings in the package manager to manage the sources. 单击包管理器中的设置以管理源。

D'oh!... In my case, I had no internet connection on the computer. 噢噢!......就我而言,我的电脑上没有网络连接。 The DNS IP address was missing. DNS IP地址丢失。 So make sure you can access the internet from the computer you're trying to install the NuGet package. 因此,请确保您可以从尝试安装NuGet软件包的计算机访问Internet。 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. 所以无法解决与没有互联网连接有关。

Copy the URL (usually 'https://api.nuget.org/v3/index.json') and place it in your browser - sometimes there's an issue with the inte.net and the NuGet Packet Manager just can't connect to the URL.复制 URL(通常为“https://api.nuget.org/v3/index.json”)并将其放入浏览器 - 有时 inte.net 和 NuGet 数据包管理器无法连接到URL。

Hope it helps for future persons having this issue.希望对以后遇到这个问题的人有所帮助。

ipconfig /flushdns在命令提示符下为我修复了它。

In my case, my virtual machine was able to access the internet via Chrome but not via Internet Explorer. 就我而言,我的虚拟机能够通过Chrome访问互联网,但不能通过Internet Explorer访问互联网。 Once I fixed the connection issues in IE (by clicking the 'Fix connection issues' button causing IE to reset the LAN adapter), NuGet was able to access the internet as well. 一旦我修复了IE中的连接问题(通过单击“修复连接问题”按钮导致IE重置LAN适配器),NuGet也能够访问互联网。

I just had this problem in a virtual machine and it was perplexing given that the url worked from a browser. 我刚刚在虚拟机中遇到了这个问题,并且由于网址是从浏览器中运行的,因此很困惑。 Updated the nuget package manager and the problem went away. 更新了nuget包管理器,问题就消失了。

Personally, I believe it just didn't recognize the nuget repo version (v3) and gave an incorrect error message. 就个人而言,我认为它只是没有识别nuget repo版本(v3)并给出了错误的错误信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 远程名称无法解析:将第三方Web服务添加到我的Web应用程序时出错 - The remote name could not be resolved: Error adding third party webservice to my web application 服务器无法使用 Team Foundation 服务 - 无法解析远程名称 - Team Foundation services are not available from server - The remote name could not be resolved 无法在Visual Studio 2015 Nuget包管理器中安装包“Microsoft.AspNet.Razor 3.2.3” - Could not install package 'Microsoft.AspNet.Razor 3.2.3' in Visual Studio 2015 Nuget package manager nuget包管理器不同步 - nuget package manager out of sync 无法安装Nuget Package Manager - Cannot install Nuget Package Manager NUget包管理器更改目录 - NUget package manager change directory 使用Package Manager(nuget)时,如何使用非唯一名称指定特定项目? - How do I target a specific project with a non-unique name when using the Package Manager (nuget)? 发送邮件失败:{“无法解析远程名称:'smtp.live.com'”} - Failure sending mail: {"The remote name could not be resolved: 'smtp.live.com'"} 减少Visual Studio nuget程序包管理器中的超时 - Reduce timeout in Visual Studio nuget package manager 尝试更新时NuGet Package Manager出错 - NuGet Package Manager errors when trying to update
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM