I have console application and code as below,
My problem is before ContinueWith task finish, the console application ends, it does not waits the continueWith to finish, please advise.
Please let me know what I am missing or incorrect.
var task1 = Task<bool>.Factory.StartNew(() => DoProcess());
task1 .ContinueWith(
t1 => updateSuccess(),
TaskContinuationOptions.NotOnFaulted | TaskContinuationOptions.ExecuteSynchronously);
task1 .ContinueWith(
t => updateFault(),
TaskContinuationOptions.OnlyOnFaulted | TaskContinuationOptions.ExecuteSynchronously);
task1.Wait();