title: How to fix "'System.AggregateException' occurred in mscorlib.dll"
body: <p>I'm receiving an unhandled exception while debugging, and the program stops executing. The debugger doesn't show me the line so I don't know what to fix.</p>
  
  <blockquote>
    <p>An unhandled exception of type '<code>System.AggregateException</code>' occurred in <code>mscorlib.dll</code></p>
    
    <p>Additional information: A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread.</p>
    
    <p>Cannot obtain value of local or argument '<code>&lt;this&gt;</code>' as it is not available at this instruction pointer, possibly because it has been optimized away.  <code>System.Threading.Tasks.TaskExceptionHolder</code></p>
  </blockquote>
  
  <p>How can I troubleshoot this problem?</p>
  
  <p>I also found <a href="https://stackoverflow.com/questions/8311303/cannot-obtain-value-of-local-or-argument-as-it-is-not-available-at-this-instruct">this question</a> which is pretty similar.</p>