In addition to the ds19 problem and the workaround (thanks!), We had a very similar problem with VS2017. In our place, servers, as a rule, do not get Internet access. With our upgrade to VS2017 and TFS2017 (Update 3), this rule should be relaxed.
We initially solved the build problem with ds19 Update 3 - Workaround , but it still left us unable to use anything other than nuget 4.0.0, as the Nuget Tool Installer task still gave a timeout error.
After working with MS, we advised us to add the CDN website (cs9.wpc.v0cdn.net) to our proxys whitelist. Once we have done this, we can also use the Nuget Tool installer task, in addition to restoring Nuget.
source share