调试 IEnumerable.Join() 的内部结构
如何调试 Join() 扩展方法的内部结构?
我不是问如何调试/查看链接方法调用之间的事情。不想在这个示例中查看点之间的内容: myThings.Where().Join();
相反,我想查看 Join() 方法的中间值或内部内部/外部序列用来发挥它的魔力。我有: myThings.Join( 一堆 lambda ); 我的 keySelectors 似乎返回正确的数据。但我的 resultSelector 永远不会被调用,所以我想查看序列本身并进行调试。
我觉得有人会推荐 resharper(我没有 150 美元的钱,所以请只提供免费的替代品)。
请回答以下问题:“如何调试 Join() 的内部结构?”
How can I debug the innards of the Join() extension method?
I am NOT asking how to debug/see things in between chained method calls. NOT tring to look between the dots in this example: myThings.Where().Join();
Instead, I want to see the intermediate values or the internal inner/outer sequences that the Join() method uses to work its mojo. I have: myThings.Join( a bunch of lambdas );
My keySelectors seem be to returning the correct data. But my resultSelector is never getting called so I want to see the sequences themselves and debug.
I feel like someone will recommend resharper (I don't have $150 to shell out, so please only offer free alternatives).
Please answer the question: "How can I debug the innards of Join()?"
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我认为 VS 中有一个调试选项可以让你调试 .net 源代码。它应该在菜单“调试”->“选项”->“常规”中
I think in VS there is an debug option to let you debug .net source code. It should be in menu Debug->Options->General
使用 Reflector .NET 7 及更高版本,您可以调试框架类型。您基本上是在调试框架的反编译版本。这是一个很好的学习方式。
Using Reflector .NET 7 and newer you're able to debug framework types. You're basically debugging the decompiled versions of the framework. It's a great way to learn.
要从概念上了解
Join
的实现方式,请查看 Jon Skeet 作为 EduLinq 的一部分的重新实现:"重新实现 LINQ到对象:第 19 部分 - 连接”。我将从这里开始,因为它可能会让您更深入地了解正在发生的事情,而不仅仅是盯着生成的代码。如果您仍然想使用免费工具反编译生成的代码,例如 JustDecompile 可用于自由的。
To get a conceptual look at how
Join
is implemented have a look at Jon Skeet's re-implementation as part of EduLinq: "Reimplementing LINQ to Objects: Part 19 - Join". I would start here because it will probably give you much more insight into what is going on than just starring at the generated code.If you still want to decompile the generated code using a free tool there is e.g. JustDecompile available for free.