问题
I'm working with Mobile App in Visual Studio 2017, but when I first created this project and tried to build it, the following error occurred:
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.
I searched and found someone suggesting I should change my DNS server from 8.8.8.8 to 208.67.222.222 but it didn't work.
How can I solve this problem?
回答1:
I hit this issue as well for all my packages. But if I copied the nupkg link to my browser, I could download the package fine. So it was an issue with VS somewhere. I filed a bug.
To workaround it, as no other solutions I found seemed to work, I downloaded nuget.exe from the Nuget Download page and then ran the following in the command line:
nuget restore MySolution.sln
This downloaded all the packages fine. Once it was done, I could run my project in VS without problems.
回答2:
Failed to download package 'runtime.win10-x86.Microsoft.Net.UWPCoreRuntimeSdk.2.1.1'
According to the error log, this issue should be more related to the internet connection, but since change DNS server not work for you and you can open that url in google chrome without timeout, I would like provide you a workaround for this issue.
Workaround:
Download the package runtime.win10-x86.Microsoft.Net.UWPCoreRuntimeSdk.2.1.1
from the nuget.org manually.
Add this package to the folder: C:\Users\<UserName>\.nuget\packages
Then you can build your project without that issue.
回答3:
Just retry. It seem to be related to slow Internet connection or server side overload and you will finally succeed.
回答4:
We will need additional information in order to investigate. Please follow the instructions in the nuget.org FAQ: https://docs.microsoft.com/en-us/nuget/nuget-org/nuget-org-faq#nugetorg-not-accessible to gather logs and contact the team as mentioned in the FAQ.
来源:https://stackoverflow.com/questions/51554477/failed-to-download-package-runtime-win10-x86-microsoft-net-uwpcoreruntimesdk-2