title: VSTS: nuget.exe failed with return code: 1 Packages failed to restore
body: <p>I am new in Visual Studio 2017 and was trying to build using Visual Studio Team Services. I am getting the following error:</p>
  
  <pre><code>System.AggregateException: One or more errors occurred. ---&gt; NuGet.Protocol.Core.Types.FatalProtocolException: Failed to retrieve information about 'Microsoft.AspNetCore' from remote source 'http://nuget.ohyeah.net/api/v2/FindPackagesById()?id='Microsoft.AspNetCore''. ---&gt; System.Net.Http.HttpRequestException: An error occurred while sending the request. ---&gt; System.Net.WebException: The remote name could not be resolved: 'nuget.ohyeah.net'
  </code></pre>
  
  <p>I was googling to make sure I know why exactly this error happens but no luck yet. A sample stack trace can be found here: <a href="https://pastebin.com/RiGmd7Cd" rel="nofollow noreferrer">https://pastebin.com/RiGmd7Cd</a> </p>
  
  <p>What could be the reason, is it because of some settings in Nuget.Config? It looks exactly like below:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;configuration&gt;
    &lt;activePackageSource&gt;
      &lt;add key="All" value="(Aggregate source)" /&gt;
    &lt;/activePackageSource&gt;
    &lt;disabledPackageSources /&gt;
    &lt;packageSources&gt;
      &lt;add key="3rdparty" value="http://nuget.XXX.net/api/v2/" /&gt;
      &lt;add key="official" value="http://nuget.XXX.net/api/v2/" /&gt;
        &lt;add key="vsts-official" value="https://XXXXXX.pkgs.visualstudio.com/_packaging/Official/nuget/v3/index.json" /&gt;
      &lt;!--&lt;add key="local" value="C:\inetpub\wwwroot\Packages" /&gt;--&gt;
      &lt;add key="microsoft" value="https://www.nuget.org/api/v2/curated-feeds/microsoftdotnet/" /&gt;
      &lt;add key="nuget.org" value="" /&gt;
    &lt;/packageSources&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>I am stuck on this, any help would be highly appreciated.</p>