title: Winforms app still crashes after unhandled exception handler
body: <p>I've applied these handlers in a <strong>test application</strong>:</p>
  
  <pre><code>    Application.ThreadException += Application_ThreadException;
      Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
      AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
      TaskScheduler.UnobservedTaskException += TaskScheduler_UnobservedTaskException;
  </code></pre>
  
  <p>I then create an exception on a nested Task/Async await on the form:</p>
  
  <p><strike>Despite the handler being fired - <code>CurrentDomain.UnhandledException</code> - the app still crashes. </p>
  
  <p>Why would it crash and not show the dialog and stay running?</p>
  
  <p><em><strong>System.Exception was unhandled
  Message: An unhandled exception of type 'System.Exception' occurred in mscorlib.dll
  Additional information: dd</em></strong></strike></p>
  
  <pre><code>private async void button1_Click(object sender, EventArgs e)
  {
      Console.WriteLine("Main " + Thread.CurrentThread.ManagedThreadId);
      try
      {
          await Hello();
      }
      catch (Exception ex)
      {
          Console.WriteLine("Exception on main  " + Thread.CurrentThread.ManagedThreadId);
      }
  }
  
  private async static Task Hello() //changed from void
  {
      await Task.Run(() =&gt; new IGetRun().Run1());
  }
  
  internal class IGetRun
  {
      public async Task Run1() //changed from void
      {
          Console.WriteLine("Run1 " + Thread.CurrentThread.ManagedThreadId);
              await Task.Run(() =&gt; new IGetRun2().Run2());
      }
  }
  
  internal class IGetRun2
  {
      public void Run2()
      {
          Console.WriteLine("Run2 " + Thread.CurrentThread.ManagedThreadId);
          throw new Exception("dd");
      }
  }
  </code></pre>
  
  <p><strong>EDIT:</strong>
  Looks like I forgot to declare each async method with Task and not void thus exception handling works predictably now. The only thing I still do not know is why - if I stop handling the exception in the button event - when the exception is caught <code>Application_ThreadException</code> is fired and not <code>TaskScheduler_UnobservedTaskException</code></p>