How to handle Task.Run Exception
问题 I had a problem with catching my exception from Task.Run I changed my code and my problem solved. I'm willing to figure out what is the difference between handling exceptions inside Task.Run in these two ways : In Outside function I can't catch the exception but in Inside I can catch it. void Outside() { try { Task.Run(() => { int z = 0; int x = 1 / z; }); } catch (Exception exception) { MessageBox.Show("Outside : " + exception.Message); } } void Inside() { Task.Run(() => { try { int z = 0;