本文介绍了禁用/删除子断点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我调试一个ASP.NET网站使用C#在Visual Studio中。当我设置一个断点(在调试过程中),随着时间的推移,创建的断点会积累很多的孩子断点。 (请参阅这里。)
现在,有时当我删除断点通过单击红色符号,断点仍然会执行该行下一次打击,因为孩子断点依然存在。
 删除断点断点窗口将解决此问题,但它很烦人的找到断点,当你有很多集。此外,去除许多儿童断点是一个相当缓慢的操作。

I'm debugging an ASP.NET Website with C# in Visual Studio. When I set a breakpoint (during debug), over time, the created breakpoint will accumulate many child breakpoints. (See here.)
Now, sometimes when I remove a breakpoint by clicking the red glyph, the breakpoint will still be hit the next time the line is executed, because the child breakpoints persisted.
Removing the breakpoint in the breakpoint window will resolve the problem, but it's annoying the find the breakpoint when you have many set. Also, the removal of a breakpoint with many children is quite a slow operation.

所以去的问题,我可以禁用这个创造孩子断点,或者是有没有办法可以快速删除所有的孩子?
替代性的解决方案AP preciated!

So to get to the question, can I disable this creation of child breakpoints, or is there a way to quickly remove all children?
Alternative solutions are appreciated!


请注意,这不是此重复:Question如何删除一个Visual Studio断点,因为我询问如何处理孩子的断点。 (虽然我们的预期目标是一致的。)


Please note that this isn't a duplicate of this: Question on how to remove a Visual Studio Breakpoint, because I'm asking how to deal with the child breakpoints. (Although our intended goal is the same.)

推荐答案

以下code可以作为宏来删除所有的孩子断点。

The following code can be used as a macro to remove all the child breakpoints.

Sub RemoveChildBreakpoints()
    Dim i As Integer
    Dim len As Integer
    Dim debugger As EnvDTE.Debugger = DTE.Debugger
    Dim children As EnvDTE.Breakpoints
    For Each bp As EnvDTE.Breakpoint In debugger.Breakpoints
        children = bp.Children
        len = children.Count
        For i = len To 1 Step -1
            children.Item(i).Delete()
        Next
    Next
End Sub

它仍然是如果你有很多断点出奇的慢,所以这是最好的,如果你有与孩子断点的问题定期做运行它。

It's still insanely slow if you have many breakpoints, so it's best to do run it on a regular basis if you're having a problem with child breakpoints.

这篇关于禁用/删除子断点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 06:42