title: Console application - try catch block doesn't work for Tasks
body: <p>It's probably a basic question but when I try to catch an exception thrown in a <code>Task</code> (in a console application) the app breaks with unhandled exception even if I call <code>task.Wait()</code> within a try catch block (adding something like <code>Thread.Sleep</code> before throwing doesn't help):</p>
  
  <pre><code>static void Main(string[] args)
  {
      Task task = Task.Run(() =&gt; { throw null; });
  
      try
      {
          task.Wait();
      }
      catch (AggregateException ae)
      {
          if (ae.InnerException is NullReferenceException)
              Console.WriteLine("Null!");
          else
              Console.WriteLine("Exception!");
      }
  
      Console.ReadLine();
  }
  </code></pre>
  
  <p>Screenshots:</p>
  
  <p><img src="https://i.stack.imgur.com/kPqIC.jpg" alt="enter image description here"></p>
  
  <p><img src="https://i.stack.imgur.com/Y1slN.jpg" alt="enter image description here"></p>