aspark
aspark

Reputation: 370

dnu was always canceled or timeout when restore the vnext mvc demo

I retrive the sample code from https://www.github.com/aspnet/home . when I restore the packages in the latest/HelloMvc folder, The following error occurred:

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 ---

but I successfully restore at 'lastest/ConsoleApp', then I use wget to download the pacakge with the failed url, there's no problems, I can unzip dlls from that package.

I have restore at 'lastest/HelloMvc' use mono 1.0.0-beta7-12274 runtime, or restore at '1.0.0-beta5/HellowMvc' use 1.0.0-beta5 runtime, or change to use the dockerfile(microsoft/aspnet), even change computer, the error is the same~

Upvotes: 5

Views: 933

Answers (2)

hemant gautam
hemant gautam

Reputation: 811

use following command env MONO_THREADS_PER_CPU=2000 dnu restore. This worked for me. You can also set global environment variable, in that case you won't have to type env MONO_THREADS_PER_CPU every time you do dnu restore.

Upvotes: 0

devlux
devlux

Reputation: 76

did you try to run mozroots --import --sync? I've found that solution on https://github.com/aspnet/Docs/issues/184 and it worked for me.

Upvotes: 5

Related Questions