static async Task Main(string[] args) { try { await AsyncCount(); } catch (Exception ex) { Console.WriteLine(ex.StackTrace); Console.WriteLine(ex.Demystify()); } Console.ReadLine(); } static async Task AsyncCount() { Iterator(2).Count(); } static IEnumerable<string> Iterator(int startAt) { var list = new List<int>() { 1, 2, 3, 4 }; foreach (var item in list) { // Throws the exception list.Add(item); yield return item.ToString(); } }