NuGet 包管理器错误:无法解析远程名称
我正在使用 1.4 版本并收到此错误:
The remote name could not be resolved: go.microsoft.com
以下是 nuget 包的 URL:
https://go.microsoft.com/fwlink/?LinkID=206669
我在这里缺少什么吗?几周前它运行良好。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(8)
我必须使用以下位置添加新的包源:
http://packages.nuget.org
单击设置在包管理器中管理源。
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.
天啊!...就我而言,我的计算机没有互联网连接。 DNS IP 地址丢失。因此,请确保您可以从尝试安装 NuGet 包的计算机访问 Internet。如果您像我现在一样在虚拟机中工作,那么特别检查这一点很重要。 :)
失败并显示以下消息:
因此无法解决与没有互联网连接有关。
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:
So the could not be resolved has to do with no internet connection.
命令提示符处的 ipconfig /flushdns 为我修复了它。
ipconfig /flushdns
at the command prompt fixed it for me.复制 URL(通常为“https://api.nuget.org/v3/index.json”)并将其放入浏览器中 - 有时互联网出现问题,NuGet Packet Manager 无法连接到该 URL 。
希望它对未来遇到此问题的人有所帮助。
Copy the URL (usually 'https://api.nuget.org/v3/index.json') and place it in your browser - sometimes there's an issue with the internet and the NuGet Packet Manager just can't connect to the URL.
Hope it helps for future persons having this issue.
当我设置新系统时,我面临同样的问题
http://packages.nuget.org
转到
工具--> NuGet 包管理器 -->包管理器设置 -->包源
名称:nuget.org
源:https://api.nuget.org/v3/index .json
对于 Visual Studio 2022
I'm Facing the same issue, While I set up my new system
http://packages.nuget.org
Go to
Tools --> NuGet Package Manager --> Package Manager settings --> Package Sources
Name: nuget.org
Source: https://api.nuget.org/v3/index.json
For Visual Studio 2022
就我而言,这很简单。我没有以管理员身份运行 Visual Studio。以管理员身份运行它为我解决了这个问题。似乎是一个愚蠢的问题,但我只是想无论如何都会分享它。
In my case it was something simple. I wasn't running Visual Studio as administrator. Running it as administrator solved it for me. Seems like a silly issue but just thought I'd share it regardless.
就我而言,我的虚拟机能够通过 Chrome 访问互联网,但不能通过 Internet Explorer 访问互联网。一旦我修复了 IE 中的连接问题(通过单击“修复连接问题”按钮导致 IE 重置 LAN 适配器),NuGet 也能够访问 Internet。
In my case, my virtual machine was able to access the internet via Chrome but not via 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.
我刚刚在虚拟机中遇到了这个问题,考虑到该 url 在浏览器中工作,这很令人困惑。更新了 nuget 包管理器,问题就消失了。
就我个人而言,我认为它只是无法识别 nuget repo 版本(v3)并给出了不正确的错误消息。
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.
Personally, I believe it just didn't recognize the nuget repo version (v3) and gave an incorrect error message.