title: Continuation is running before antecedents have finished
body: <p>I have two long running tasks that I want to execute, to be followed with a continuation. The problem I am having is that the continuation is running before the two long running tasks have signalled. Those two tasks are not erroring, they've barely started when the continuation commences.
  The intent is that the first two tasks can run in parallel, but the continuation should only run once they've both finished.</p>
  <p>I have probably overlooked something really simple, but near as I can tell I am following the patterns suggested in the question <em><a href="https://stackoverflow.com/q/25009437/833115">Running multiple async tasks and waiting for them all to complete</a></em>. I realise I could probably dispense with the <code>.ContinueWith()</code> as the code following the <code>Task.WhenAll()</code> will implicitly become a continuation, but I prefer to keep the explicit continuation (unless it is the cause of my issue).</p>
  <pre><code>private async Task MyMethod()
  {
      var tasks = new List&lt;Task&gt;
      {
          new Task(async () =&gt; await DoLongRunningTask1()),
          new Task(async () =&gt; await DoLongRunningTask2())
      };
  
      Parallel.ForEach(tasks, async task =&gt; task.Start());
  
      await Task.WhenAll(tasks)
      .ContinueWith(async t =&gt;{
                                  //another long running bit of code with some parallel
                                  //execution based on the results of the first two tasks
                              }
                              , TaskContinuationOptions.OnlyOnRanToCompletion);
  
  }
  
  private async Task DoLongRunningTask1()
  {
      ... long running operation ...
  }
  
  private async Task DoLongRunningTask2()
  {
      ... another long running operation ...
  }
  </code></pre>
  <p>I appreciate any help or suggestions!</p>