有什么方法可以中断在Visual Studio中执行的下一行代码吗? [英] Is there any way to break on the next line of code executed in Visual Studio?

查看:109
本文介绍了有什么方法可以中断在Visual Studio中执行的下一行代码吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正试图找出在单击aspx页面上的特定元素时发生的错误...

I'm trying to track down a bug that occurs when I click a particular element on an aspx page...

过去,我不得不跟踪处理该特定事件的类,并在我认为应该击中的行上放置一个断点。通常,在最终找到正确的类之前,我需要花很多时间才能尝试...。特别是如果该类是埋在某处的用户控件...

In the past I've had to track down the class that handles that particular event and put a break point on the line that I think should be hit. Often it takes me several tries before I finally find the correct class....especially if the class is a user control buried somewhere...

如果有任何方法可以使Visual Studio在单击aspx页面上的元素(例如按钮)后在下一行执行的代码处中断。我知道有一种方法可以打破引发的任何异常,所以我在想也许有些类似的东西可以对我有所帮助。

So it's left me wondering if there is any way to get Visual Studio to break at the next line of code executed after I click an element (say a button) on an aspx page. I know there is a way to break on any exception that is thrown so I'm thinking maybe there is something similar that could help me.

如果这种功能不是不可能,也许有人会建议我一种更好的方法来快速找到我要调试的类...

If this sort of feature isn't a possibility, perhaps someone could suggest a better way for me to quickly find the class I want to debug...

推荐答案

您是否尝试过调试>全部中断(暂停)按钮? ( Ctrl + Break

Have you tried the Debug > Break All ("pause") button? (Ctrl+Break)

通常会破坏堆栈中的某个位置,例如在Show()中WinForms应用程序中的表单,但如果您跨步进入该表单,则对于这种情况通常会非常有效。

It'll usually break somewhere pretty low on the stack, like at Show() for your main form in a WinForms app, but if you then Step Into to get past that, it'll often work pretty well for this sort of thing.

这篇关于有什么方法可以中断在Visual Studio中执行的下一行代码吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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