Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why do my breakpoints duplicate in Visual Studio?

I recently started having problems with breakpoints in Visual Studio 2010. When I set a breakpoint and then start debugging, another breakpoint appears on some other line nearby. The screenshots below shows the editor after I set a breakpoint, as well as the breakpoints window:

Editor

Breakpoints window

As soon as I start debugging, the breakpoint duplicates, as seen in the following screenshots:

Editor while debugging

Breakpoints window while debugging

Why is this happening and how can I stop it?

like image 553
Antoine Aubry Avatar asked Feb 03 '12 15:02

Antoine Aubry


People also ask

How do I keep breakpoints in Visual Studio?

To set a breakpoint in source code: Click in the far left margin next to a line of code. You can also select the line and press F9, select Debug > Toggle Breakpoint, or right-click and select Breakpoint > Insert breakpoint. The breakpoint appears as a red dot in the left margin.

Why are my breakpoints not working?

If a source file has changed and the source no longer matches the code you're debugging, the debugger won't set breakpoints in the code by default. Normally, this problem happens when a source file is changed, but the source code wasn't rebuilt. To fix this issue, rebuild the project.

How do I add a breakpoint to all methods in Visual Studio?

Press F3 and then press F9 to add a breakpoint.

Where are Visual Studio breakpoints stored?

They are saved in the <solutionname>. suo file. SUO stands for Solution User Options, and should not be added to source control.


1 Answers

It looks like there is a child breakpoint set up, as described in the following MSDN articles: http://msdn.microsoft.com/en-us/library/b98cwcyw.aspx (Link dead, see Child breakpoints VS 2010)
http://msdn.microsoft.com/en-us/library/02ckd1z7%28VS.71%29.aspx#vctskbreakpointswindowchildbreakpoints

Here is a similar question on StackOverflow, for which one of the answers contains a macro to remove child breakpoints. Perhaps that might work for you? Disable/remove child Breakpoints?

Alternatively, deleting the parent breakpoint (which will also remove the children) and re-creating it might help to resolve the problem.

like image 87
David Avatar answered Sep 19 '22 06:09

David