NuGet / Home

Repo for NuGet Client issues
Other
1.5k stars 253 forks source link

Cannot complete dotnet restore because some requests timed out after 100000ms #2945

Closed Konard closed 6 years ago

Konard commented 8 years ago

Trying to make a simple hello world application using instructions from https://www.microsoft.com/net/core#windows

We tried dotnet restore, but it is timeouts too much.

When we tried dotnet restore --disable-parallel it became better, but still it is not possible to download all packages.

The main problem we suspect is a slow and unstable internet connection (4G). Is it possible to increase a 100000ms timeout limit?

C:\Users\darksalim\hwapp>dotnet --info 
.NET Command Line Tools (1.0.0-preview1-002702) 

Product Information: 
Version: 1.0.0-preview1-002702 
Commit Sha: 6cde21225e 

Runtime Environment: 
OS Name: Windows 
OS Version: 6.1.7601 
OS Platform: Windows 
RID: win7-x64
joelverhagen commented 8 years ago

There is currently not an option to increase the timeout duration. Could you provide a log file for both dotnet restore and for dotnet restore --disable-parallel?

Have you tried a different version of Windows or a the same steps on a different network?

Also, this issue reminds me of https://github.com/dotnet/cli/issues/1732. There are a couple suggestions for different scenarios and network configurations.

Konard commented 8 years ago

Log for dotnet restore --disable-parallel:

info : The HTTP request to 'GET https://api.nuget.org/v3-flatcontainer/system.gl 
obalization/index.json' has timed out after 100000ms. 
info : An error was encountered when fetching 'GET https://api.nuget.org/v3-flat 
container/system.resources.resourcemanager/index.json'. The request will now be 
retried. 
info : The HTTP request to 'GET https://api.nuget.org/v3-flatcontainer/system.re 
sources.resourcemanager/index.json' has timed out after 100000ms. 
info : An error was encountered when fetching 'GET https://api.nuget.org/v3-flat 
container/system.reflection/index.json'. The request will now be retried. 
info : The HTTP request to 'GET https://api.nuget.org/v3-flatcontainer/system.re 
flection/index.json' has timed out after 100000ms. 
info : An error was encountered when fetching 'GET https://api.nuget.org/v3-flat 
container/system.reflection.primitives/index.json'. The request will now be retr 
ied. 
info : The HTTP request to 'GET https://api.nuget.org/v3-flatcontainer/system.re 
flection.primitives/index.json' has timed out after 100000ms. 
info : An error was encountered when fetching 'GET https://api.nuget.org/v3-flat 
container/system.linq/index.json'. The request will now be retried. 
info : The HTTP request to 'GET https://api.nuget.org/v3-flatcontainer/system.li 
nq/index.json' has timed out after 100000ms. 
info : An error was encountered when fetching 'GET https://api.nuget.org/v3-flat 
container/system.reflection.extensions/index.json'. The request will now be retr 
ied. 
info : The HTTP request to 'GET https://api.nuget.org/v3-flatcontainer/system.re 
flection.extensions/index.json' has timed out after 100000ms. 
info : An error was encountered when fetching 'GET https://api.nuget.org/v3-flat 
container/system.objectmodel/index.json'. The request will now be retried. 
info : The HTTP request to 'GET https://api.nuget.org/v3-flatcontainer/system.ob 
jectmodel/index.json' has timed out after 100000ms. 
info : An error was encountered when fetching 'GET https://api.nuget.org/v3-flat 
container/system.runtime.interopservices/index.json'. The request will now be re 
tried. 
info : The HTTP request to 'GET https://api.nuget.org/v3-flatcontainer/system.ru 
ntime.interopservices/index.json' has timed out after 100000ms.
info : GET https://api.nuget.org/v3-flatcontainer/system.diagnos.. 
ex.json 
info : GET https://api.nuget.org/v3-flatcontainer/system.globali.. 
son 
info : GET https://api.nuget.org/v3-flatcontainer/system.reflect.. 
/index.json 
info : GET https://api.nuget.org/v3-flatcontainer/system.resourc..
ager/index.json 
info : GET https://api.nuget.org/v3-flatcontainer/system.objectm.. 
n 
info : GET https://api.nuget.org/v3-flatcontainer/system.reflect.. 
/index.json 
info : GET https://api.nuget.org/v3-flatcontainer/system.linq/in.. 
info : GET https://api.nuget.org/v3-flatcontainer/system.reflect.. 

info : GET https://api.nuget.org/v3-flatcontainer/system.runtime.. 
es/index.json 
info : An error was encountered when fetching 'GET https://api.nuget.org/v3-flat 
container/system.threading/index.json'. The request will now be retried. 
info : The HTTP request to 'GET https://api.nuget.org/v3-flatcontainer/system.th 
reading/index.json' has timed out after 100000ms. 
info : GET https://api.nuget.org/v3-flatcontainer/system.threadi..
info : An error was encountered when fetching 'GET https://api.nuget.org/v3-flat 
container/system.runtime/index.json'. The request will now be retried. 
info : The HTTP request to 'GET https://api.nuget.org/v3-flatcontainer/system.ru 
ntime/index.json' has timed out after 100000ms. 
info : GET https://api.nuget.org/v3-flatcontainer/system.runtime.. 
info : An error was encountered when fetching 'GET https://api.nuget.org/v3-flat 
container/system.io.filesystem.watcher/4.0.0-rc2-24027/system.io.filesystem.watc
her.4.0.0-rc2-24027.nupkg'. The request will now be retried. 
info : The HTTP request to 'GET https://api.nuget.org/v3-flatcontainer/system.io 
.filesystem.watcher/4.0.0-rc2-24027/system.io.filesystem.watcher.4.0.0-rc2-24027 
.nupkg' has timed out after 100000ms. 
info : An error was encountered when fetching 'GET https://api.nuget.org/v3-flat 
container/system.runtime.extensions/index.json'. The request will now be retried 
. 
info : The HTTP request to 'GET https://api.nuget.org/v3-flatcontainer/system.ru 
ntime.extensions/index.json' has timed out after 100000ms. 
info : GET https://api.nuget.org/v3-flatcontainer/system.io.file.. 
/4.0.0-rc2-24027/system.io.filesystem.watcher.4.0.0-rc2-24027.nupkg 
info : GET https://api.nuget.org/v3-flatcontainer/system.runtime.. 
dex.json 
info : An error was encountered when fetching 'GET https://api.nuget.org/v3-flat 
container/system.io.memorymappedfiles/4.0.0-rc2-24027/system.io.memorymappedfile 
s.4.0.0-rc2-24027.nupkg'. The request will now be retried. 
info : The HTTP request to 'GET https://api.nuget.org/v3-flatcontainer/system.io 
.memorymappedfiles/4.0.0-rc2-24027/system.io.memorymappedfiles.4.0.0-rc2-24027.n 
upkg' has timed out after 100000ms. 
info : GET https://api.nuget.org/v3-flatcontainer/system.io.memo.. 
4.0.0-rc2-24027/system.io.memorymappedfiles.4.0.0-rc2-24027.nupkg 
info : An error was encountered when fetching 'GET https://api.nuget.org/v3-flat 
container/system.threading.thread/4.0.0-rc2-24027/system.threading.thread.4.0.0- 
rc2-24027.nupkg'. The request will now be retried. 
info : The HTTP request to 'GET https://api.nuget.org/v3-flatcontainer/system.th 
reading.thread/4.0.0-rc2-24027/system.threading.thread.4.0.0-rc2-24027.nupkg' ha 
s timed out after 100000ms. 
info : GET https://api.nuget.org/v3-flatcontainer/system.threadi... 
0-rc2-24027/system.threading.thread.4.0.0-rc2-24027.nupkg 
info : An error was encountered when fetching 'GET https://api.nuget.org/v3-flat 
container/microsoft.netcore.dotnethostresolver/index.json'. The request will now 
be retried. 
info : The HTTP request to 'GET https://api.nuget.org/v3-flatcontainer/microsoft 
.netcore.dotnethostresolver/index.json' has timed out after 100000ms. 
info : GET https://api.nuget.org/v3-flatcontainer/microsoft.netc.. 
resolver/index.json 
info : An error was encountered when fetching 'GET https://api.nuget.org/v3-flat 
container/system.io.unmanagedmemorystream/4.0.1-rc2-24027/system.io.unmanagedmem 
orystream.4.0.1-rc2-24027.nupkg'. The request will now be retried. 
info : The HTTP request to 'GET https://api.nuget.org/v3-flatcontainer/system.io 
.unmanagedmemorystream/4.0.1-rc2-24027/system.io.unmanagedmemorystream.4.0.1-rc2 
-24027.nupkg' has timed out after 100000ms. 
info : GET https://api.nuget.org/v3-flatcontainer/system.io.unma.. 
eam/4.0.1-rc2-24027/system.io.unmanagedmemorystream.4.0.1-rc2-24027.nupkg 
info : An error was encountered when fetching 'GET https://api.nuget.org/v3-flat 
container/system.linq.expressions/4.0.11-rc2-24027/system.linq.expressions.4.0.1 
1-rc2-24027.nupkg'. The request will now be retried. 
info : The HTTP request to 'GET https://api.nuget.org/v3-flatcontainer/system.li 
nq.expressions/4.0.11-rc2-24027/system.linq.expressions.4.0.11-rc2-24027.nupkg' 
has timed out after 100000ms. 
info : GET https://api.nuget.org/v3-flatcontainer/system.linq.ex...
11-rc2-24027/system.linq.expressions.4.0.11-rc2-24027.nupkg 
info : An error was encountered when fetching 'GET https://api.nuget.org/v3-flat 
container/system.runtime.handles/index.json'. The request will now be retried. 
info : The HTTP request to 'GET https://api.nuget.org/v3-flatcontainer/system.ru 
ntime.handles/index.json' has timed out after 100000ms. 
info : GET https://api.nuget.org/v3-flatcontainer/system.runtime.. 
.json 
info : An error was encountered when fetching 'GET
https://api.nuget.org/v3-flat 
container/system.linq.parallel/4.0.1-rc2-24027/system.linq.parallel.4.0.1-rc2-24 
027.nupkg'. The request will now be retried. 
info : The HTTP request to 'GET https://api.nuget.org/v3-flatcontainer/system.li 
nq.parallel/4.0.1-rc2-24027/system.linq.parallel.4.0.1-rc2-24027.nupkg' has time 
d out after 100000ms. 
info : GET https://api.nuget.org/v3-flatcontainer/system.linq.pa.. 
c2-24027/system.linq.parallel.4.0.1-rc2-24027.nupkg 
info : An error was encountered when fetching 'GET https://api.nuget.org/v3-flat 
container/system.linq.queryable/4.0.1-rc2-24027/system.linq.queryable.4.0.1-rc2- 
24027.nupkg'. The request will now be retried. 
info : The HTTP request to 'GET https://api.nuget.org/v3-flatcontainer/system.li 
nq.queryable/4.0.1-rc2-24027/system.linq.queryable.4.0.1-rc2-24027.nupkg' has ti 
med out after 100000ms. 
info : GET https://api.nuget.org/v3-flatcontainer/system.linq.qu..-
rc2-24027/system.linq.queryable.4.0.1-rc2-24027.nupkg 
info : An error was encountered when fetching 'GET https://api.nuget.org/v3-flat 
container/system.net.nameresolution/4.0.0-rc2-24027/system.net.nameresolution.4. 
0.0-rc2-24027.nupkg'. The request will now be retried. 
info : The HTTP request to 'GET https://api.nuget.org/v3-flatcontainer/system.ne 
t.nameresolution/4.0.0-rc2-24027/system.net.nameresolution.4.0.0-rc2-24027.nupkg 
' has timed out after 100000ms. 
info : GET https://api.nuget.org/v3-flatcontainer/system.net.nam... 
0.0-rc2-24027/system.net.nameresolution.4.0.0-rc2-24027.nupkg 
info : An error was encountered when fetching 'GET https://api.nuget.org/v3-flat 
container/system.net.requests/4.0.11-rc2-24027/system.net.requests.4.0.11-rc2-24 
027.nupkg'. The request will now be retried. 
info : The HTTP request to 'GET https://api.nuget.org/v3-flatcontainer/system.ne 
t.requests/4.0.11-rc2-24027/system.net.requests.4.0.11-rc2-24027.nupkg' has time 
d out after 100000ms. 
info : GET https://api.nuget.org/v3-flatcontainer/system.net.req..
c2-24027/system.net.requests.4.0.11-rc2-24027.nupkg 
info : An error was encountered when fetching 'GET https://api.nuget.org/v3-flat 
container/microsoft.netcore.runtime/index.json'. The request will now be retried 
. 
info : The HTTP request to 'GET https://api.nuget.org/v3-flatcontainer/microsoft 
.netcore.runtime/index.json' has timed out after 100000ms. 
info : An error was encountered when fetching 'GET https://api.nuget.org/v3-flat 
container/system.globalization.calendars/index.json'. The request will now be re 
tried. 
info : The HTTP request to 'GET https://api.nuget.org/v3-flatcontainer/system.gl 
obalization.calendars/index.json' has timed out after 100000ms.
info : GET https://api.nuget.org/v3-flatcontainer/microsoft.netc.. 
dex.json 
info : GET https://api.nuget.org/v3-flatcontainer/system.globali.. 
rs/index.json 
info : An error was encountered when fetching 'GET https://api.nuget.org/v3-flat 
container/system.threading.tasks/index.json'. The request will now be retried. 
info : The HTTP request to 'GET https://api.nuget.org/v3-flatcontainer/system.th 
reading.tasks/index.json' has timed out after 100000ms. 
info : GET https://api.nuget.org/v3-flatcontainer/system.threadi..
.json 
info : An error was encountered when fetching 'GET https://api.nuget.org/v3-flat 
container/system.appcontext/index.json'. The request will now be retried. 
info : The HTTP request to 'GET https://api.nuget.org/v3-flatcontainer/system.ap 
pcontext/index.json' has timed out after 100000ms. 
info : GET https://api.nuget.org/v3-flatcontainer/system.appcont.. 

info : An error was encountered when fetching 'GET https://api.nuget.org/v3-flat 
container/system.xml.readerwriter/index.json'. The request will now be retried. 
info : The HTTP request to 'GET https://api.nuget.org/v3-flatcontainer/system.xm 
l.readerwriter/index.json' has timed out after
100000ms. 
info : GET https://api.nuget.org/v3-flatcontainer/system.xml.rea..
x.json 
info : An error was encountered when fetching 'GET https://api.nuget.org/v3-flat 
container/microsoft.netcore.platforms/index.json'. The request will now be retri 
ed. 
info : The HTTP request to 'GET https://api.nuget.org/v3-flatcontainer/microsoft 
.netcore.platforms/index.json' has timed out after 100000ms. 
info : GET https://api.nuget.org/v3-flatcontainer/microsoft.netc.. 
index.json 
info : An error was encountered when fetching 'GET https://api.nuget.org/v3-flat 
container/system.net.primitives/index.json'. The request will now be retried. 
info : The HTTP request to 'GET https://api.nuget.org/v3-flatcontainer/system.ne 
t.primitives/index.json' has timed out after 100000ms. 
info : GET https://api.nuget.org/v3-flatcontainer/system.net.pri... 
json 
info : An error was encountered when fetching 'GET https://api.nuget.org/v3-flat 
container/system.net.http/index.json'. The request will now be retried. 
info : The HTTP request to 'GET https://api.nuget.org/v3-flatcontainer/system.ne 
t.http/index.json' has timed out after 100000ms. 
info : An error was encountered when fetching 'GET https://api.nuget.org/v3-flat 
container/system.runtime.numerics/index.json'. The request will now be retried. 
info : The HTTP request to 'GET https://api.nuget.org/v3-flatcontainer/system.ru 
ntime.numerics/index.json' has timed out after 100000ms. 
info : GET https://api.nuget.org/v3-flatcontainer/system.net.htt.. 
info : GET https://api.nuget.org/v3-flatcontainer/system.runtime.. 
x.json 
info : An error was encountered when fetching 'GET https://api.nuget.org/v3-flat 
container/system.net.sockets/index.json'. The request will now be retried. 
info : The HTTP request to 'GET https://api.nuget.org/v3-flatcontainer/system.ne 
t.sockets/index.json' has timed out after 100000ms. 
info : GET https://api.nuget.org/v3-flatcontainer/system.net.soc..
n 
info : An error was encountered when fetching 'GET https://api.nuget.org/v3-flat 
container/system.io.filesystem.primitives/index.json'. The request will now be r 
etried. 
info : The HTTP request to 'GET https://api.nuget.org/v3-flatcontainer/system.io 
.filesystem.primitives/index.json' has timed out after 100000ms. 
info : An error was encountered when fetching 'GET https://api.nuget.org/v3-flat 
container/system.net.security/4.0.0-rc2-24027/system.net.security.4.0.0-rc2-2402 
7.nupkg'. The request will now be retried. 
info : The HTTP request to 'GET https://api.nuget.org/v3-flatcontainer/system.ne 
t.security/4.0.0-rc2-24027/system.net.security.4.0.0-rc2-24027.nupkg' has timed 
out after 100000ms. 
info : GET https://api.nuget.org/v3-flatcontainer/system.io.file.. 
ves/index.json 
info : GET https://api.nuget.org/v3-flatcontainer/system.net.sec.. 
2-24027/system.net.security.4.0.0-rc2-24027.nupkg 
info : An error was encountered when fetching 'GET https://api.nuget.org/v3-flat 
container/system.xml.xdocument/index.json'. The request will now be retried. 
info : The HTTP request to 'GET https://api.nuget.org/v3-flatcontainer/system.xm 
l.xdocument/index.json' has timed out after 100000ms. 
info : GET https://api.nuget.org/v3-flatcontainer/system.xml.xdo.. 
son 
info : An error was encountered when fetching 'GET https://api.nuget.org/v3-flat 
container/system.text.encoding/index.json'. The request will now be retried. 
info : The HTTP request to 'GET https://api.nuget.org/v3-flatcontainer/system.te 
xt.encoding/index.json' has timed out after 100000ms. 
info : An error was encountered when fetching 'GET https://api.nuget.org/v3-flat 
container/system.io.compression.zipfile/index.json'. The request will now be ret 
ried. 
info : The HTTP request to 'GET https://api.nuget.org/v3-flatcontainer/system.io 
.compression.zipfile/index.json' has timed out after 100000ms. 
info : GET
https://api.nuget.org/v3-flatcontainer/system.text.en.. 
son 
info : GET https://api.nuget.org/v3-flatcontainer/system.io.comp.. 
e/index.json 
info : An error was encountered when fetching 'GET https://api.nuget.org/v3-flat 
container/system.net.webheadercollection/4.0.1-rc2-24027/system.net.webheadercol 
lection.4.0.1-rc2-24027.nupkg'. The request will now be retried. 
info : The HTTP request to 'GET https://api.nuget.org/v3-flatcontainer/system.ne 
t.webheadercollection/4.0.1-rc2-24027/system.net.webheadercollection.4.0.1-rc2-2 
4027.nupkg' has timed out after 100000ms. 
info : GET https://api.nuget.org/v3-flatcontainer/system.net.web.. 
on/4.0.1-rc2-24027/system.net.webheadercollection.4.0.1-rc2-24027.nupkg 
info : An error was encountered when fetching 'GET https://api.nuget.org/v3-flat 
container/system.text.encoding.extensions/index.json'. The request will now be r 
etried. 
info : The HTTP request to 'GET https://api.nuget.org/v3-flatcontainer/system.te 
xt.encoding.extensions/index.json' has timed out after 100000ms. 
info : An error was encountered when fetching 'GET https://api.nuget.org/v3-flat 
container/system.runtime.interopservices.runtimeinformation/index.json'. The req 
uest will now be retried. 
info : The HTTP request to 'GET https://api.nuget.org/v3-flatcontainer/system.ru 
ntime.interopservices.runtimeinformation/index.json' has timed out after 100000m 
s. 
info : GET https://api.nuget.org/v3-flatcontainer/system.runtime.. 
es.runtimeinformation/index.json 
info : An error was encountered when fetching 'GET https://api.nuget.org/v3-flat 
container/system.io.filesystem/index.json'. The request will now be retried. 
info : The HTTP request to 'GET https://api.nuget.org/v3-flatcontainer/system.io 
.filesystem/index.json' has timed out after 100000ms. 
info : GET https://api.nuget.org/v3-flatcontainer/system.text.en.. 
ons/index.json 
info : GET https://api.nuget.org/v3-flatcontainer/system.io.file.. 
son 
info : An error was encountered when fetching 'GET https://api.nuget.org/v3-flat 
container/system.collections.concurrent/index.json'. The request will now be ret 
ried. 
info : The HTTP request to 'GET https://api.nuget.org/v3-flatcontainer/system.co 
llections.concurrent/index.json' has timed out after 100000ms. 
info : An error was encountered when fetching 'GET https://api.nuget.org/v3-flat 
container/system.diagnostics.tracing/index.json'. The request will now be retrie 
d. 
info : The HTTP request to 'GET https://api.nuget.org/v3-flatcontainer/system.di 
agnostics.tracing/index.json' has timed out after 100000ms. 
info : An error was encountered when fetching 'GET https://api.nuget.org/v3-flat 
container/system.text.regularexpressions/index.json'. The request will now be re 
tried. 
info : The HTTP request to 'GET https://api.nuget.org/v3-flatcontainer/system.te 
xt.regularexpressions/index.json' has timed out after 100000ms.
info : GET https://api.nuget.org/v3-flatcontainer/system.collect.. 
t/index.json 
info : GET https://api.nuget.org/v3-flatcontainer/system.text.re.. 
ns/index.json 
info : GET https://api.nuget.org/v3-flatcontainer/system.diagnos.. 
ndex.json

_1gcpvmmdda

.NET Core was installed using https://go.microsoft.com/fwlink/?LinkID=798398 (https://download.microsoft.com/download/4/6/1/46116DFF-29F9-4FF8-94BF-F9BE05BE263B/packages/DotNetCore.1.0.0.RC2-SDK.Preview1-x64.exe)

And this is a real machine, not a virtual machine. So there is no possibility to just install other version of Windows, and this is the only network available.

We have tried to download first link seperately: https://api.nuget.org/v3-flatcontainer/system.globalization/index.json

zdabpqho1zc

gjnxpjy7i8o

... and this working ok.

joelverhagen commented 8 years ago

Is this a full log? Are all of the requests failing like this? Or do requests at the beginning of execution work just fine and, only after a while, do requests start timing out? One issue is it seems that the --disable-parallel switch still allows multiple concurrent HTTP requests. I will investigate whether this is intended.

Konard commented 8 years ago

3wwntz0umnu

Some files was downloaded ok. This was a part of log of last rerun of restore (so it contains only those files that was non downloaded ok). We will try to run restore again. And I`ll provide a full log in txt file.

Konard commented 8 years ago

The log is truncated by cmd, so only the end of log is available: dotnet restore log.txt

There are videos of the process: https://www.youtube.com/watch?v=y64jBe8ecMU https://www.youtube.com/watch?v=XZlrqeAQ5sg https://www.youtube.com/watch?v=v4nOgwQdegQ

joelverhagen commented 8 years ago

Does executing nuget.exe restore project.json also hang? Try using this version of NuGet.exe: https://dist.nuget.org/win-x86-commandline/v3.5.0-beta/NuGet.exe

roji commented 8 years ago

+1

I'm on an odd/crappy Internet connection which for some reason reacts badly to many concurrent connections. --disable-parallel doesn't seem to actually disable parallel HTTP connections, unfortunately.

Trying the v3.5.0-beta doesn't seem to change anything for me.

It's also unfortunate that the timeout value itself can't be adjusted.

Konard commented 8 years ago

It's also unfortunate that the timeout value itself can't be adjusted.

+1

joelverhagen commented 8 years ago

I've improved -DisableParallel on NuGet.exe and checked the change into our dev branch. The -DisableParallel (and --disable-parallel on dotnet restore) switch only impacts specific parts of the restore process. I have extended this to include HTTP concurrency during restore.

Could you give this prerelease build a try and see if it solves your problem? NuGet-dev-1506.zip

You can use nuget.exe restore instead of dotnet restore to try out this prerelease build.

joelverhagen commented 8 years ago

Hey @Konard, have you had a chance to try this newer nuget.exe that supports disabling parallel HTTP? If this resolves the problem, I would still like to keep this issue open to track potential improvements in these two areas:

  1. Configuring HTTP timeout value
  2. Setting arbitrary levels of HTTP parallelism (maybe 1 is too slow, 16 is too much for your connection, but 4 is the "sweet spot").
Konard commented 8 years ago

Yes, the nuget.exe restore -DisableParallel successfully downloaded all packages.

nuget.exe.txt

Videos: https://youtu.be/CfZ5QVNAFsg https://youtu.be/HWXR6vvtJGg

Jalalx commented 7 years ago

I had same issue and here is my solution:

  1. Disable all other network interfaces.
  2. Open %TEMP%\NugetScratch and delete all files.
  3. Delete project.lock.json (if exists) from your repository folder.
  4. Run dotnet restore and it should restore them successfully.

Here is my dotnet info:

.NET Command Line Tools (1.0.0-preview2-1-003177)

Product Information:
 Version:            1.0.0-preview2-1-003177
 Commit SHA-1 hash:  a2df9c2576

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.10240
 OS Platform: Windows
 RID:         win10-x64
allyusd commented 7 years ago

Some problem with VirtualBox Host-Only Network, Disabling the VirtualBox Adapter fixed it for me.

ref: dotnet restore consistently times out on Win7x64

.NET Command Line Tools (1.0.1)

Product Information:
 Version:            1.0.1
 Commit SHA-1 hash:  005db40cd1

Runtime Environment:
 OS Name:     Windows
 OS Version:  6.1.7601
 OS Platform: Windows
 RID:         win7-x64
 Base Path:   C:\Program Files\dotnet\sdk\1.0.1
emgarten commented 6 years ago

Thanks for reporting this issue. We have not been able to reproduce this issue. If you are still able to reproduce this with the latest NuGet version, please provide additional steps.