title: How to manage properly an exception in a Task with ContinueWith
body: <p>After reading information about task and exepcion management, I am using this code to manage an exception thrown in a Task:</p>
  
  <pre><code>Task&lt;Object&gt; myTask = Task.Factory.StartNew&lt;Object&gt;(doTask, CancellationToken.None,   TaskCreationOptions.None, TaskScheduler.Default);
  myTask .ContinueWith(task =&gt; afterTask(task), TaskScheduler.FromCurrentSynchronizationContext());
  </code></pre>
  
  <p>Where doTask and AfterTask are:</p>
  
  <pre><code>private &lt;Object&gt; doTask() {
      throw new Exception("BOOM");
  }
  
  private afterTask(Task&lt;Object&gt; aTask) {
  
          if (aTask.IsFaulted)
          {
              MessageBox.Show(aTask.Exception.InnerException.Message);
          }
          else //whatever
  }
  </code></pre>
  
  <p>When Exception Boom is thrown the Visual Studio shows an alert informing that an exception has not been caught but if I continue executing the exception is processed in the afterTask function.</p>
  
  <p>Is this code correct or I missunderstood some basic behaviour of the task? There is any way to avoid the alert from the debugger that the execption has not been caught? Is a bit annoying...</p>
  
  <p>Thanks in advance           </p>