I got a huge IEnumerable
and when i try to convert it in Array
:
var arr = myEnumerable.ToArray();
I got an error:
An unhandled exception of type 'System.StackOverflowException' occurred in System.Core.dll
Same error fired when i do another operations with this collection for example:
var count = myEnumerable.Count();
In Visual Studio
i tried to see this collections's properties but when i put mouse coursor on it debug mode end end to work.
I fix this and remove IEnumerable
and work with Array
only.
But what i don't understand. My code covered by try catch
but i can not handle this exception.
In meny QA i read that i can't handle StackOverflowException
what fired in non user code.
Does it mean that all can do it is just fix error and do not try to catch StackOverflowException
?