Task does not wait for ContinueWith to finish

前端 未结 3 500
南旧
南旧 2021-01-19 16:42

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 fini

3条回答
  •  天涯浪人
    2021-01-19 17:16

    I tried another solution that worked for me :

    try {
        taskNotOnFaulted.Wait();
    } catch {
        taskOnlyOnFaulted.Wait();
    }
    

提交回复
热议问题