ContinueWith TaskContinuationOptions.OnlyOnFaulted does not seem to catch an exception thrown from a started task
I'm trying to catch an exception thrown from a task method using ContinueWith and OnlyOnFaulted like below. However I get an unhandled exception while I try to run this code. I'd like the task to run to completion since I have handled the exception already. But Task.Wait() runs into AggregateException. var taskAction = new Action(() => { Thread.Sleep(1000); Console.WriteLine("Task Waited for a sec"); throw (new Exception("throwing for example")); }); Task t = Task.Factory.StartNew(taskAction); t.ContinueWith(x => Console.WriteLine("In the on Faulted continue with code. Catched exception from