VS调试"快速监视"工具和lambda前pressions [英] VS debugging "quick watch" tool and lambda expressions

查看:471
本文介绍了VS调试"快速监视"工具和lambda前pressions的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么我不能用拉姆达前pressions而在快速查看窗口调试?

Why can't I use lambda expressions while debugging in "Quick watch" window?

UPD:又见

<一个href=\"http://blogs.msdn.com/b/jaredpar/archive/2009/08/26/why-no-linq-in-debugger-windows.aspx\">http://blogs.msdn.com/b/jaredpar/archive/2009/08/26/why-no-linq-in-debugger-windows.aspx

<一个href=\"http://blogs.msdn.com/b/jaredpar/archive/2010/06/02/why-is-linq-absent-from-debugger-windows-part-2.aspx\">http://blogs.msdn.com/b/jaredpar/archive/2010/06/02/why-is-linq-absent-from-debugger-windows-part-2.aspx

推荐答案

LAMBDA前pressions,像匿名方法,实际上是非常复杂的野兽。即使我们排除防爆pression (.NET 3.5),仍然留下的很多的复杂性,并非最不重要的被捕获变量,这从根本上重新构造使用它们的code(你认为的变量成为编译器生成的类字段),带着几分雾里看花。

Lambda expressions, like anonymous methods, are actually very complex beasts. Even if we rule out Expression (.NET 3.5), that still leaves a lot of complexity, not least being captured variables, which fundamentally re-structure the code that uses them (what you think of as variables become fields on compiler-generated classes), with a bit of smoke and mirrors.

因此​​,我丝毫不惊讶,你可以不会坐视使用它们 - 有一个的很多的编译工作(和类型一代幕后)的支持这个魔术。

As such, I'm not in the least surprised that you can't use them idly - there is a lot of compiler work (and type generation behind the scenes) that supports this magic.

这篇关于VS调试&QUOT;快速监视&QUOT;工具和lambda前pressions的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆