This code :
IEnumerable lines = File.ReadLines(\"file path\"); foreach (var line in lines) { Console.WriteLine(line); } foreach (var line
It isn't a bug. But I believe you can use ReadAllLines() to do what you want instead. ReadAllLines creates a string array and pulls in all the lines into the array, instead of just a simple enumerator over a stream like ReadLines does.