title: How can I allow Task exceptions to propagate back to the UI thread?
body: <p>In TPL, if an exception is thrown by a <a href="http://msdn.microsoft.com/en-us/library/system.threading.tasks.task.aspx" rel="noreferrer">Task</a>, that exception is captured and stored in <a href="http://msdn.microsoft.com/en-us/library/system.threading.tasks.task.exception.aspx" rel="noreferrer">Task.Exception</a>, and then follows all the rules on <a href="http://msdn.microsoft.com/en-us/library/dd997415.aspx" rel="noreferrer">observed exceptions</a>. If it's never observed, it's eventually rethrown on the finalizer thread and crashes the process.</p>
  
  <p>Is there a way to prevent the Task from catching that exception, and just letting it propagate instead?</p>
  
  <p>The Task I'm interested in would already be running on the UI thread (courtesy of <a href="http://msdn.microsoft.com/en-us/library/system.threading.tasks.taskscheduler.fromcurrentsynchronizationcontext.aspx" rel="noreferrer">TaskScheduler.FromCurrentSynchronizationContext</a>), and I want the exception to escape so it can be handled by my existing <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.application.threadexception.aspx" rel="noreferrer">Application.ThreadException</a> handler.</p>
  
  <p>I basically want unhandled exceptions in the Task to behave like unhandled exceptions in a button-click handler: immediately propagate on the UI thread, and be handled by ThreadException.</p>