title: TPL cancellation continuation never called on cancelled Task
body: <p>I have the following setup in my code that utilizes the TPL:</p>
  
  <ul>
  <li>One field in my class: private CancellationTokenSource _cancellationTokenSource;</li>
  <li>This CancellationTokeSource gets instatiated every time I create a TPL task that uses that particular cancellationtoken</li>
  </ul>
  
  <p>The actualy TPL tasks look like this:</p>
  
  <pre><code>var dataRetrievalTask = new Task&lt;List&lt;myType&gt;&gt;(() =&gt;
              {
                  // retrieve data and do something
                  foreach (var a in retrievalMethod())
                  {
                      if (_cancellationTokenSource.Token.IsCancellationRequested)
                          _cancellationTokenSource.Token.ThrowIfCancellationRequested();
  
                          // do something if not cancelled
                      }
                  }
  
                  return filledListOfMyType;
  
              }, _cancellationTokenSource.Token);
  
              // define what shall happen if data retrievel finished without any problems
              var writingLoadedDataToGridTask = dataRetrievalTask.ContinueWith(task =&gt;
              {
                // do something in case we ran to completion without error
              }, _cancellationTokenSource.Token, TaskContinuationOptions.OnlyOnRanToCompletion, currentScheduler);
  
              // what to do in case cancellation was performed
              var loadingDataCancelledTask = dataRetrievalTask.ContinueWith(task =&gt;
                                {
                                  someLabel.Text = "Data retrieval canceled.";
                                },_cancellationTokenSource.Token, TaskContinuationOptions.OnlyOnCanceled, currentScheduler);
  
              // what to do in case an exception / error occured
              var loadingDataFaulted = dataRetrievalTask.ContinueWith(task =&gt;
                  {
                      someLabel.Text = string.Format("Data retrieval ended with an Error.");
                  }, _cancellationTokenSource.Token, TaskContinuationOptions.OnlyOnFaulted, currentScheduler);
  
              // when any of the continuation tasks ran through, reset ui controls / buttons etc
              Task.Factory.ContinueWhenAny(new[] { writingLoadedDataToGridTask, loadingDataCancelledTask, loadingDataFaulted }, task =&gt;
              {
                // reset controls and all that
              }, _cancellationTokenSource.Token, TaskContinuationOptions.None, currentScheduler);
  
  
              dataRetrievalTask.Start();
  </code></pre>
  
  <p>Now my problem is that when the _cancellationTokenSource.Cancel() method is called somewhere (in a Cancel-button's .Click event handler) that particular loadingDataCancelledTask's body/method isn't called.</p>
  
  <p>What am I doing wrong here? I am using and handing over the same _cancellationTokenSource.Token instance... and everything else (the 'writingLoadedDataToGridTask' and 'loadingDataFaulted' tasks &amp; the following 'Task.Factory.ContinueWhenAny(new[] { writingLoadedDataToGridTask, loadingDataCancelledTask, loadingDataFaulted }, task => ...' block) do actually work. Only cancellation does not. Does anyone see/know why?</p>