title: ConfigureAwait(False) doesn't change context after ContinueWith()
body: <p>I don't know if I am doing something wrong or I found a bug in the Async library, but I have seen an issue  when running some async code after I came back to the Synchronized context with continueWith(). </p>
  
  <p><strong>UPDATE: The code now runs</strong>    </p>
  
  <pre><code>using System;
  using System.ComponentModel;
  using System.Net.Http;
  using System.Threading.Tasks;
  using System.Windows.Forms;
  
  namespace WindowsFormsApplication1
  {
  internal static class Program
  {
      [STAThread]
      private static void Main()
      {
          Application.EnableVisualStyles();
          Application.SetCompatibleTextRenderingDefault(false);
          Application.Run(new Form1());
      }
  }
  
  public partial class Form1 : Form
  {
      public Form1()
      {
          InitializeComponent();
          MainFrameController controller = new MainFrameController(this);
          //First async call without continueWith
          controller.DoWork();
  
          //Second async call with continueWith
          controller.DoAsyncWork();
      }
  
      public void Callback(Task&lt;HttpResponseMessage&gt; task)
      {
          Console.Write(task.Result); //IT WORKS
  
          MainFrameController controller =
              new MainFrameController(this);
          //third async call
          controller.DoWork(); //IT WILL DEADLOCK, since ConfigureAwait(false) in HttpClient DOESN'T  change context
      }
  }
  
  
  internal class MainFrameController
  {
      private readonly Form1 form;
  
      public MainFrameController(Form1 form)
      {
          this.form = form;
      }
  
      public void DoAsyncWork()
      {
          Task&lt;HttpResponseMessage&gt; task = Task&lt;HttpResponseMessage&gt;.Factory.StartNew(() =&gt; DoWork());
          CallbackWithAsyncResult(task);
      }
  
      private void CallbackWithAsyncResult(Task&lt;HttpResponseMessage&gt; asyncPrerequisiteCheck)
      {
          asyncPrerequisiteCheck.ContinueWith(task =&gt;
              form.Callback(task),
              TaskScheduler.FromCurrentSynchronizationContext());
      }
  
      public HttpResponseMessage DoWork()
      {
          MyHttpClient myClient = new MyHttpClient();
          return myClient.RunAsyncGet().Result;
      }
  }
  
  internal class MyHttpClient
  {
      public async Task&lt;HttpResponseMessage&gt; RunAsyncGet()
      {
          HttpClient client = new HttpClient();
          return await client.GetAsync("https://www.google.no").ConfigureAwait(false);
      }
  }
  
  partial class Form1
  {
      private IContainer components;
  
      protected override void Dispose(bool disposing)
      {
          if (disposing &amp;&amp; (components != null))
          {
              components.Dispose();
          }
          base.Dispose(disposing);
      }
  
      #region Windows Form Designer generated code
      private void InitializeComponent()
      {
          this.components = new System.ComponentModel.Container();
          this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
          this.Text = "Form1";
      }
  
      #endregion
  }
  }
  </code></pre>
  
  <ul>
  <li>The HttpClient code which is async runs well the first time. </li>
  <li>Then, I run the second async code and return to the UI context with ContinueWith, and it works well.</li>
  <li>I run the HttClient code again, but it deadlock because this time ConfigureAwait(false) does not change the context.</li>
  </ul>