Task.WaitAll, how to find the tasks causing AggregateException
You still have the list of Tasks
, and each Task
has an Exception
property. Using that you can figure out which exceptions belong with which Task
.
But, if you can, it'd be better to use Task.WhenAll
or TaskFactory.ContinueWhenAll
than do a blocking Wait.
var throwers = tasks.Where(task => task.Exception != null);