title: ThreadAbortException when calling Task.Result
body: <p>I have the following code where I'm trying to make a request to a remote endpoint using <code>HttpClient</code>:</p>
  
  <pre><code>using (var client = new HttpClient())
  {
     client.BaseAddress = _serviceBaseAddress;
  
     Task&lt;HttpResponseMessage&gt; readResponseTask = client.GetAsync(relativeUri);
     readResponseTask.Wait();
  
     using (var response = readResponseTask.Result)
     {
       if (response.StatusCode == HttpStatusCode.NotFound || !response.IsSuccessStatusCode)
       {
         return default(TResult);
       }
  
       Task&lt;TResult&gt; readContentTask = response.Content.ReadAsAsync&lt;TResult&gt;();
       readContentTask.Wait();
  
       TResult value = readContentTask.Result;
  
       return value;
     }
   }
  </code></pre>
  
  <p>..and occassionally I would get <code>ThreadAbortException</code> at the <code>readResponseTask.Result</code> like so:</p>
  
  <blockquote>
    <p>System.Threading.ThreadAbortException: Thread was being aborted.    at
    System.Threading.Monitor.ObjWait(Boolean exitContext, Int32
    millisecondsTimeout, Object obj)    at
    System.Threading.ManualResetEventSlim.Wait(Int32 millisecondsTimeout,
    CancellationToken cancellationToken)    at
    System.Threading.Tasks.Task.SpinThenBlockingWait(Int32
    millisecondsTimeout, CancellationToken cancellationToken)    at
    System.Threading.Tasks.Task.InternalWait(Int32 millisecondsTimeout,
    CancellationToken cancellationToken)    at
    System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout,
    CancellationToken cancellationToken)</p>
  </blockquote>
  
  <p>Under what circumstance will the <code>.Result</code> throw such an exception? I have tried simulating a timeout on the remote endpoint but I got the exception at the <code>.Wait()</code> instead of <code>.Result</code>. Since the exception happens after <code>.Wait()</code>, I'm assuming the result has already been returned from the remote site but somehow something went wrong when it tries to access the result. </p>
  
  <p>Any clues? Could it be something to do with thread concurrency?</p>