Ras*_*med 8 c# compiler-errors visual-studio nuget
我正在 Visual Studio 2017 中使用 Mobile App,但是当我第一次创建这个项目并尝试构建它时,发生了以下错误:
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.
Run Code Online (Sandbox Code Playgroud)
我搜索并发现有人建议我应该将我的 DNS 服务器从 8.8.8.8 更改为 208.67.222.222 但它没有用。
我怎么解决这个问题?
Mic*_*SFT 20
我的所有包裹也遇到了这个问题。但是如果我将 nupkg 链接复制到我的浏览器,我可以很好地下载包。所以这是VS某处的问题。我提交了一个错误。
为了解决这个问题,因为我发现没有其他解决方案似乎有效,我从Nuget 下载页面下载了nuget.exe,然后在命令行中运行以下命令:
nuget restore MySolution.sln
Run Code Online (Sandbox Code Playgroud)
这下载了所有软件包。完成后,我可以毫无问题地在 VS 中运行我的项目。
无法下载包“runtime.win10-x86.Microsoft.Net.UWPCoreRuntimeSdk.2.1.1”
根据错误日志,这个问题应该与互联网连接更相关,但是由于更改 DNS 服务器对您不起作用,并且您可以在 google chrome 中打开该网址而不会超时,我想为您提供解决此问题的方法。
解决方法:
runtime.win10-x86.Microsoft.Net.UWPCoreRuntimeSdk.2.1.1手动从nuget.org下载包。
将此包添加到文件夹中:C:\Users\<UserName>\.nuget\packages
然后你就可以构建你的项目而不会出现这个问题。