我有一段代碼,使得在Visual Studio 2008 IDE運行速度很慢,消耗大量的內存並最終導致其崩潰。我懷疑VS正在達到操作系統內存限制。嵌套的LINQ MIN()崩潰的Visual Studio
下面的代碼不是我真正的應用程序代碼,但它模擬了這個問題。基本上我正在嘗試使用LINQ在樹中查找最小值。
class LinqTest
{
public class test
{
public int val;
public List<test> Tests;
}
private void CrashMe()
{
test t = new test();
//Uncomment this to cause the problem
//var x = t.Tests.Min(c => c.Tests.Min(d => d.Tests.Min(e => e.Tests.Min(f=>f.Tests.Min(g=>g.Tests.Min(h => h.val))))));
}
}
有沒有其他人看過類似的東西?
我正在使用原始海報,並在我的登錄頁面提交了錯誤報告:https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=476133 – geofftnz 2009-07-22 00:11:17