【发布时间】:2019-01-04 08:57:21
【问题描述】:
我在 Visual Studio 2017 中使用移动应用程序,但是当我第一次创建此项目并尝试构建它时,出现以下错误:
Failed to download package 'runtime.win10-x86.Microsoft.Net.UWPCoreRuntimeSdk.2.1.1' from 'https://api.nuget.org/v3-flatcontainer/runtime.win10-x86.microsoft.net.uwpcoreruntimesdk/2.1.1/runtime.win10-x86.microsoft.net.uwpcoreruntimesdk.2.1.1.nupkg'.
The HTTP request to 'GET https://api.nuget.org/v3-flatcontainer/runtime.win10-x86.microsoft.net.uwpcoreruntimesdk/2.1.1/runtime.win10-x86.microsoft.net.uwpcoreruntimesdk.2.1.1.nupkg' has timed out after 100000ms.
我搜索并发现有人建议我将我的 DNS 服务器从 8.8.8.8 更改为 208.67.222.222,但没有成功。
我该如何解决这个问题?
【问题讨论】:
-
URL 在 Firefox 中不会超时。试试打开cmd运行
tracert api.nuget.org?您是否曾经使用您的 HOSTS 文件/等来阻止 Microsoft 跟踪? -
我在 google chrome 中打开了这个 url 并且没有超时。您所说的 HOSTS 文件是什么意思。你能给我一个链接来解释这个吗?
-
如果 URL 在 Chrome 中没有超时,则 HOSTS 文件不会导致您的问题。 (这是一种重定向域的方法,例如将 Microsoft 跟踪域重定向到无效服务器。)
-
直到现在,我还没有找到任何解决我的问题的方法。
-
我在尝试将 UWP nuget 包
Microsoft.NETCore.UniversalWindowsPlatform从版本 6.2.9 升级到 6.2.10 时遇到了这个问题,@Michael 的解决方法奏效了
标签: c# visual-studio compiler-errors nuget