title: Re-throw exception in task (TPL) loses stack trace
body: <p>I've code that rethrows an exception. </p>
  
  <p>When I later read the exception from task.Exception, its stacktrace points to the location where I re-threw the exception (line n and not line m, as I expected).</p>
  
  <p>Why is this so? bug in TPL or more likely something I have overlooked.</p>
  
  <p>As I workaround I can wrap the exception as the inner-exception in a new exception.</p>
  
  <pre><code>internal class Program
  {
      private static void Main(string[] args)
      {
          Task.Factory.StartNew(TaskMethod).ContinueWith(t =&gt; Console.WriteLine(t.Exception.InnerException));
          Console.Read();
      }
  
      private static void TaskMethod()
      {
          try
          {
  line m:     throw new Exception("Todo");
          }
          catch (Exception)
          {
  line n:     throw;
          }
      }
  }
  </code></pre>