title: Parallel.ForEach and httpClient.GetAsync throws AggregateException (InnerException:"A task was cancelled")
body: <p>I am using Parallel.ForEach to execute about 2200 requests (httpClient.GetAsync) so I can get the data needed faster. While sometimes this process passes without exception often I end up with AggregateException (InnerException:"A task was cancelled").</p>
  
  <p>Cancel() is not called and I am using the default request Timeout.</p>
  
  <p>There are suggestions to remove the using of the HttpClient creation and use a single instance of it, but it did not help.</p>
  
  <p>Any ideas what causes the exception and how to prevent it?</p>
  
  <pre><code>    public void GetData()
      {
         ConcurrentBag&lt;MyItem&gt; alltems = new ConcurrentBag&lt;MyItem&gt;();
  
         Parallel.For(0, listOfUrls, url =&gt;
          {
             allItems.Add(MyMethod(this.Get(url));
          }
      }
  
      public HttpResponseMessage Get(string url)
      {
          httpClient = NewHttpClient();
          {
              var requestContent = httpClient.GetAsync(this.siteUrl + "/" + url).Result;
              return requestContent;
          }
      }
  
      HttpClient cachedHttpClient;
      private HttpClient NewHttpClient(bool skipAuthorization = false)
      {
          var h = new WebRequestHandler();
  
          if (cachedHttpClient == null)
          {
              var client = new HttpClient(h);
              if (!skipAuthorization)
              {
                  client.DefaultRequestHeaders.Add("Authorization", "WRAP access_token=" + accessToken);
              }
              return client;
          }
          else
          {
              return cachedHttpClient;
          }
      }
  </code></pre>