I am doing some benchmarking on different ways to read a CSV file and found a "wierd" problem. The problem being that when I use this method in a console application:
var lines = File.ReadAllLines(fileName); // OutOfMemoryException
foreach (var line in lines)
{
//doing stuff
}
I get an OutOfMemoryException, but when I use the same method in my WPF project it works fine. The file im testing this on is 730MB and I know not to use ReadAllLines on bigger CSV files but why does this method work in the WPF application but not in the console application?