我从https://www.github.com/aspnet/home中检索示例代码。当我恢复最新/ HelloMvc文件夹中的包时,发生以下错误:
Warning: FindPackagesById: Microsoft.AspNet.Http.Features
HTTP request timed out. Retrying.
GET https://nuget.org/api/v2/FindPackagesById()?id='Microsoft.AspNet.Http.Features'
Error: FindPackagesById: Microsoft.AspNet.Hosting.Server.Abstractions
HTTP request timed out. Exiting.
Error: FindPackagesById: Microsoft.Framework.Configuration
HTTP request timed out. Exiting.
Error: FindPackagesById: Microsoft.AspNet.Http
HTTP request timed out. Exiting.
Error: FindPackagesById: Microsoft.Framework.Configuration.EnvironmentVariables
HTTP request timed out. Exiting.
Error: FindPackagesById: Microsoft.Framework.Configuration.CommandLine
HTTP request timed out. Exiting.
Error: FindPackagesById: Microsoft.Framework.DependencyInjection
HTTP request timed out. Exiting.
Error: FindPackagesById: Microsoft.Framework.Configuration.Ini
HTTP request timed out. Exiting.
Error: FindPackagesById: Microsoft.Framework.Logging
HTTP request timed out. Exiting.
----------
System.Threading.Tasks.TaskCanceledException: A task was canceled.
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00000] in <filename unknown>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00000] in <filename unknown>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00000] in <filename unknown>:0
at System.Runtime.CompilerServices.TaskAwaiter`1[System.Net.Http.HttpResponseMessage].GetResult () [0x00000] in <filename unknown>:0
at System.Net.Http.HttpClientHandler+<SendAsync>c__async0.MoveNext () [0x00000] in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
但我成功恢复'lastest / ConsoleApp',然后我使用wget下载带有失败网址的pacakge,没有问题,我可以从该软件包中解压dll。
我已恢复'lastest / HelloMvc'使用mono 1.0.0-beta7-12274运行时,或恢复'1.0.0-beta5 / HellowMvc'使用1.0.0-beta5运行时,或更改为使用dockerfile( microsoft / aspnet),即使更换电脑,错误也是一样的〜
答案 0 :(得分:5)
mozroots --import --sync
吗?我在https://github.com/aspnet/Docs/issues/184找到了解决方案并且对我有用。
答案 1 :(得分:0)
使用以下命令 env MONO_THREADS_PER_CPU = 2000 dnu restore 。这对我有用。您还可以设置全局环境变量,在这种情况下,每次执行 dnu restore 时都不必键入 env MONO_THREADS_PER_CPU 。