Код: Выделить всё
public static async Task Main()
{
await Task.WhenAny(
Task.WhenAll(
Task.Run(() => throw new Exception("This exception is lost")),
Task.Run(() => Task.Delay(100))),
Task.Run(() => Task.Delay(1000)));
await Task.WhenAll(
Task.Run(() => Task.Delay(100)),
Task.Run(() => throw new Exception("This exception is reported")));
}
Подробнее здесь: https://stackoverflow.com/questions/797 ... th-timeout