执行foreach时出现An unhandled exception of type 'System.StackOverflowException' occurred in mscorlib.dll的错误查解

执行一个Foreach循环时,系统提示:
An unhandled exception of type 'System.StackOverflowException' occurred in mscorlib.dll
从字面上看,是堆栈溢出错误。

进过查找,发现这是因为进入了死循环,系统给出的提示。
修改程序解决死循环后,问题解决。

原文地址:https://www.cnblogs.com/benbenkoala/p/1029016.html