调试与步入动态代理
有谁知道如何进入由(在我的例子中)Spring AOP 机制管理的类的目标方法?
如果我单步执行代码并到达 orderDao.FindOrder(orderId),并尝试单步执行该方法,我将到达代理类本身,而不是我的 OrderDAO。
我当然明白为什么会发生这种情况。不过,我确信我能够在某个时刻直接进入我的方法(即调试器绕过所有 AOP 内容并直接进入我的代码。
但它停止工作了,我不知道我能得到什么也许我已经取消选中了 VisualStudio (2010) 中的设置
,然后检查了调试器中的“仅我的代码”选项,看看是否有帮助,但得到了相同的结果,
谢谢。
Does anyone know how to step into the target method of a class that is being managed by (in my case) Spring's AOP mechanism?
If I am stepping through my code and get to e.g. orderDao.FindOrder(orderId), and try and step into that method, I get to the proxy class itself, rather than my OrderDAO.
I understand why that would happen of course. However I'm sure I was able to just step into my method directly at some point (i.e. the debugger is bypassing all the AOP stuff and just going directly to my code.
But it's stopped working, and I have no idea what I could have done to stop it from doing this. A setting in VisualStudio (2010) somewhere perhaps?
I've unchecked and then checked the 'Just my code' option in the debugger to see if that helps, but get the same results.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我在评论中回答了这个问题,但如果其他人正在寻找解决方案,那么很明显...
您可以告诉 VS 在工具、选项、调试、符号中调试时仅包含您自己的 DLL。然后通过在“指定模块”部分添加每个 DLL 来设置包含/排除过滤器。
另外,在“工具”、“选项”、“调试”中,有一个名为“仅我的代码”的复选框。这可能值得切换(不确定),但我认为它是默认启用的,所以你可能不需要为此烦恼。
I answered this in the comments, but just so it's obvious if someone else is looking for a solution...
You can tell VS only to include your own DLLs when debugging in Tools, Options, Debugging, Symbols. Then set up an include/exclude filter by adding each of your DLLs in the 'specified modules' section.
Also, in Tools, Options, Debugging, there is a checkbox called "Just my code". That's probably worth toggling (not sure) but I think it's enabled by default so you might not need to bother with this.