Disable/remove child Breakpoints?

前端 未结 3 552
猫巷女王i
猫巷女王i 2020-12-11 02:40

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.

3条回答
  •  猫巷女王i
    2020-12-11 03:07

    Here's an updated macro for the new javascript based macro add-in (https://marketplace.visualstudio.com/items?itemName=VisualStudioPlatformTeam.MacrosforVisualStudio) to remove all children breakpoints:

    /// 
    try {
    
        var outputWindowPane = dte.Windows.Item("{34E76E81-EE4A-11D0-AE2E-00A0C90FFFC3}").Object.ActivePane;
        outputWindowPane.Activate();
        outputWindowPane.OutputString("display this text in the output window panel\n");
    
        var i;
        var len;
        var dbgr = dte.Debugger;
        var brk = dbgr.Breakpoints;
        outputWindowPane.OutputString("There are " + brk.Count + " Total\n");
        //Macro.InsertText("There are " + brk.Count + " Total");
        for (var bpi = 1; bpi <= brk.Count; bpi++) {
            outputWindowPane.OutputString("On " + bpi + " of " + brk.Count + "\n");
            var bp = brk.Item(bpi);
            var children = bp.Children;
            var len = children.Count;
            
            for (var chi = len; chi > 0; chi--) {
                outputWindowPane.OutputString(" Children Count = " + children.Count + "\n");
                children.Item(chi).Delete();
            }
        }
    }
    catch (e) {
        outputWindowPane.OutputString("Error\n");
        outputWindowPane.OutputString(e + "\n");
    }

提交回复
热议问题