【问题标题】:Why is "Evaluation of lambda expressions is not valid in the debugger"?为什么“对 lambda 表达式的评估在调试器中无效”?
【发布时间】:2009-12-15 14:54:29
【问题描述】:

我有一个看似无辜的代码 sn-p,我将其输入到 Visual Studio 2008 即时窗口

? results.Join(lstDocs, Function(docID) docID)
Evaluation of lambda expressions is not valid in the debugger.

如消息所述,无法在调试器中调用 lambda 表达式。
为什么不允许?

【问题讨论】:

    标签: .net visual-studio visual-studio-2008 debugging lambda


    【解决方案1】:

    这里:Why is LINQ absent from debugger windows?

    还有这个之前的问题:VS debugging “quick watch” tool and lambda expressions

    简而言之,就是复杂性。

    【讨论】:

    • @Jason:根据我读到的内容,你的总结总结得很好。谢谢。
    • 真的,真的缺少 Rails 控制台在过渡到 EF/.NET 的能力。
    【解决方案2】:

    http://msdn.microsoft.com/en-us/library/bb763138.aspx

    这在设计上是不可能的。 Lambda 表达式需要在即时窗口中动态生成代码。调试器和/或评估器无法处理此问题。如果您真的想知道原因,请询问 VS 的开发人员。也许这是某个时候即将推出的功能。 Lambda 表达式是一个非常重要的新特性

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-02-05
      • 1970-01-01
      • 1970-01-01
      • 2020-04-28
      • 1970-01-01
      • 2015-12-11
      相关资源
      最近更新 更多