Bug in the File.ReadLines(..) method of the .net framework 4.0

后端 未结 7 1372
渐次进展
渐次进展 2021-01-11 16:31

This code :

IEnumerable lines = File.ReadLines(\"file path\");
foreach (var line in lines)
{
    Console.WriteLine(line); 
}
foreach (var line          


        
7条回答
  •  一向
    一向 (楼主)
    2021-01-11 16:34

    I know this is old, but i actually just ran into this while working on some code on a Windows 7 machine. Contrary to what people were saying here, this actually was a bug. See this link.

    So the easy fix is to update your .net framefork. I thought this was worth updating since this was the top search result.

提交回复
热议问题