如何在Visual Studio 2005/2008中永久删除断点(ASP.NET,C#)

时间:2022-11-05 15:16:28

Often, when I have a breakpoint on some line in Visual Studio, The program will run and stop there. great. I will then click the red circle (or press F9) to remove it. Obviously I don't want my program to keep stopping there. The problem is that the next time I refresh the page the breakpoint is back! The only way to permanently remove it is to open the breakpoints window and remove it there. Why does this happen and how can I change this behavior?

通常,当我在Visual Studio中的某些行上有断点时,程序将运行并停在那里。大。然后,我将点击红色圆圈(或按F9)将其删除。显然我不希望我的程序一直停在那里。问题是,下次刷新页面时,断点又回来了!永久删除它的唯一方法是打开断点窗口并将其删除。为什么会发生这种情况?如何更改此行为?

I have noticed that these breakpoints which keep coming back have a little plus next to them in the breakpoints window which when you click on - open up many sub lines of breakpoints. What is the deal with that?

我注意到这些断点不断回来的断点在断点窗口旁边加了一点点,当你点击时 - 打开许多断点子行。有什么处理?

Thanks, Adin

6 个解决方案

#1


16  

Helpful Key combo: to permanently delete all breakpoints, press CTRL + SHIFT + F9.

有用的键组合:要永久删除所有断点,请按CTRL + SHIFT + F9。

#2


6  

Just clear the breakpoint while the debugger is off. When you clear or add a breakpoint while debugging, the action only lasts for that debugging session.

在调试器关闭时清除断点。在调试时清除或添加断点时,该操作仅持续该调试会话。

#3


3  

The plus in the breakpoints window is there when one user-supplied breakpoint binds in multiple places. This can happen when a single file is loaded multiple times in the same debugging session, for example. The + lets you look at each of the places it bound.

当一个用户提供的断点在多个位置绑定时,断点窗口中的加号就会出现。例如,当在同一个调试会话中多次加载单个文件时,可能会发生这种情况。 +让你看看它绑定的每个地方。

@Joel: modifying breakpoints during a debugging session does not make your change temporary, although there are circumstances (like the original question), where the actual behavior can be non-obvious.

@Joel:在调试会话期间修改断点不会使您的更改成为临时更改,尽管有些情况(如原始问题),实际行为可能不明显。

#4


2  

I've post suggestion to MS to fix it: https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=391642

我已向MS发布建议以修复它:https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedidID = 391642

#5


1  

It appears since Visual Studio allows multiple breakpoints on a single line, i.e. in separate sub-clauses, architecturally it allows multiple identical breakpoints. The interface does not necessarily reflect this and you will see the removal of a breakpoint as graphically removing it, but not programmatically removing all instances of it.

它出现是因为Visual Studio允许在一行上有多个断点,即在单独的子子句中,在架构上它允许多个相同的断点。接口不一定反映这一点,您将看到删除断点以图形方式删除它,但不会以编程方式删除它的所有实例。

Looking at the Debug > Windows > Breakpoints window shows for a given set of breakpoints on a line, they are stored in a sub-tree under that line item. Removing a breakpoint while watching this list will reveal the behaviour, that only one of a series of identical breakpoints is removed from the list associated with that line. By removing the breakpoint line item and with it all sub items it will completely remove all instances of the breakpoint.

查看Debug> Windows> Breakpoints窗口,显示一行中给定的断点集,它们存储在该行项下的子树中。在观察此列表时删除断点将显示行为,即从与该行关联的列表中仅删除一系列相同断点中的一个。通过删除断点行项目以及所有子项目,它将完全删除断点的所有实例。

#6


0  

Wipe the breakpoint out using the Breakpoints Window (Ctrl + Alt + B).

使用“断点”窗口(Ctrl + Alt + B)擦除断点。

While debugging, when you hit the breakpoint, look at the BreakPoint window for the one that is bold.

在调试时,当您点击断点时,请查看BreakPoint窗口中的粗体。

Then, right-click it and choose Delete.

然后,右键单击它并选择“删除”。

#1


16  

Helpful Key combo: to permanently delete all breakpoints, press CTRL + SHIFT + F9.

有用的键组合:要永久删除所有断点,请按CTRL + SHIFT + F9。

#2


6  

Just clear the breakpoint while the debugger is off. When you clear or add a breakpoint while debugging, the action only lasts for that debugging session.

在调试器关闭时清除断点。在调试时清除或添加断点时,该操作仅持续该调试会话。

#3


3  

The plus in the breakpoints window is there when one user-supplied breakpoint binds in multiple places. This can happen when a single file is loaded multiple times in the same debugging session, for example. The + lets you look at each of the places it bound.

当一个用户提供的断点在多个位置绑定时,断点窗口中的加号就会出现。例如,当在同一个调试会话中多次加载单个文件时,可能会发生这种情况。 +让你看看它绑定的每个地方。

@Joel: modifying breakpoints during a debugging session does not make your change temporary, although there are circumstances (like the original question), where the actual behavior can be non-obvious.

@Joel:在调试会话期间修改断点不会使您的更改成为临时更改,尽管有些情况(如原始问题),实际行为可能不明显。

#4


2  

I've post suggestion to MS to fix it: https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=391642

我已向MS发布建议以修复它:https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedidID = 391642

#5


1  

It appears since Visual Studio allows multiple breakpoints on a single line, i.e. in separate sub-clauses, architecturally it allows multiple identical breakpoints. The interface does not necessarily reflect this and you will see the removal of a breakpoint as graphically removing it, but not programmatically removing all instances of it.

它出现是因为Visual Studio允许在一行上有多个断点,即在单独的子子句中,在架构上它允许多个相同的断点。接口不一定反映这一点,您将看到删除断点以图形方式删除它,但不会以编程方式删除它的所有实例。

Looking at the Debug > Windows > Breakpoints window shows for a given set of breakpoints on a line, they are stored in a sub-tree under that line item. Removing a breakpoint while watching this list will reveal the behaviour, that only one of a series of identical breakpoints is removed from the list associated with that line. By removing the breakpoint line item and with it all sub items it will completely remove all instances of the breakpoint.

查看Debug> Windows> Breakpoints窗口,显示一行中给定的断点集,它们存储在该行项下的子树中。在观察此列表时删除断点将显示行为,即从与该行关联的列表中仅删除一系列相同断点中的一个。通过删除断点行项目以及所有子项目,它将完全删除断点的所有实例。

#6


0  

Wipe the breakpoint out using the Breakpoints Window (Ctrl + Alt + B).

使用“断点”窗口(Ctrl + Alt + B)擦除断点。

While debugging, when you hit the breakpoint, look at the BreakPoint window for the one that is bold.

在调试时,当您点击断点时,请查看BreakPoint窗口中的粗体。

Then, right-click it and choose Delete.

然后,右键单击它并选择“删除”。