Visual Studio能够记住以前调试会话中的断点,这非常棒。

但是,当我在调试时,通过单击它来清除其中一个“旧”断点时,它只是被暂时删除了。我的意思是,下次调试时,我以为我删除的断点又回来了。

这非常烦人——有没有设置让它不这样做?


进入调试菜单,然后按Ctrl+Shift+F9删除所有断点


问题是断点的子断点会持续存在。在调试会话期间设置断点时会创建子断点(在某些情况下)。

删除断点(及其子)的一种可靠方法是在断点窗口中手动查找断点,并从那里删除它。(选择条目的顶部节点,点击Delete。)

如果你正在运行一个支持VBScript宏的(旧)版本的Visual Studio,你可以运行这里发布的宏(在调试会话之间),以删除子断点。这将使通过单击符号来删除断点在某种程度上更加有效和可预测,但这仍然是有问题的和尴尬的。


Start your debug session with a minimal number of files open, as you debug the unwanted breakpoints will show up and the containing files will open in new tabs. Terminate the debug session and open the breakpoints window (from the debug toolbar, for some reason it is not in the view menu). For each file, enter the name of the file in the search area of the breakpoints window and press enter to filter out the breakpoints by file. You can then click on each breakpoint in the window to see where they are located in the code and delete them if you want. A bit tedious but that the best way I found to get rid of those unwanted ghost breakpoints... Bookmarks and breakpoints management.. Those functions were probably last enhanced sometime during the last century...


大多数断点都可以在调试期间删除,但有些会卡住(可能是Visual Studio中的bug)。

如果你只想删除被卡住的断点,那么使用调试菜单上的“断点”窗口。在这里,您可能会看到您的断点对于同一行存在多次。只需右键单击并删除它。


这里有一些答案,但在我看来,在调试期间使用建议的操作会分散注意力(我不想失去我的注意力)。

我在断点期间使用粘断点的流程如下:

在调试期间,禁用断点,而不是删除它。

禁用断点的可能方法:

鼠标悬停,点击两个循环图标; 或者使用上下文菜单; 或键盘快捷键CTRL+F9(不是Shift+CTRL+F9,因为它清除所有断点)。

稍后,在开发过程中,当我看到一个禁用的断点时,我会删除它。

PS.偶尔删除所有断点也是一个很好的实践。


我一直在努力寻找“断点窗口”。这里有一个快速打开它的方法- ctrl+alt+B


或者你可以手动转到“调试->Windows->断点”来打开它。


或者你可以按ctrl+shift+F9一次删除所有断点!


用Visual Studio 2017快速回答这个老问题。

如果可能的话,只需剪切并粘贴带有断点的代码。断点随着切割而消失。


去调试>窗口>断点,找到断点,并从窗格中删除它们。

正如这里的回答


我认为这是一个设计缺陷,它非常令人沮丧,我们不得不长期忍受。我们经常碰到它,这已经成为常态。到目前为止给出的解决方案都是可行的。

一个更好的解决方案是聚在一起投票改变Visual Studio用户声音。这似乎已经被记录了几次,所以我们应该选择一个投票。

https://visualstudio.uservoice.com/forums/121579-visual-studio-ide/suggestions/31123351-delete-disable-break-point-while-debugging-should


如果你正在调试一个web应用程序,并在chrome中设置了一个断点,VS code会尊重这个断点,不会让你删除它。换句话说,有效的断点是在VS Code和chrome中设置的断点的总和。是的,有时候很容易忘记你在chrome中设置了一个断点,并迷失在试图弄清楚如何从VS Code中删除它。


在Vscode的新版本中,它被称为:Remove all Breakpoints

Vscode版:

Version: 1.57.1
Commit: 507ce72a4466fbb27b715c3722558bb15afa9f48
Date: 2021-06-17T13:28:32.912Z (1 wk ago)