11

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?

abatishchev
  • 98,240
  • 88
  • 296
  • 433
Antoine Aubry
  • 12,203
  • 10
  • 45
  • 74
  • As a fall back, if no better answer comes your way, you could reset your settings. See here: "Reset Settings - http://msdn.microsoft.com/en-us/library/ms241273(v=vs.100).aspx" – Bear In Hat Feb 03 '12 at 15:35

4 Answers4

3

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.

Community
  • 1
  • 1
David
  • 786
  • 6
  • 2
0

I suspect it is because of mismatched newline endings. I had similar issue - multiple lines were marked as breakpoint location (say, 10 lines). Later I found it was because of only \n or \r present, instead of CRLF sequence.

Use Save-As, select Save With Encoding.. option under Save button in SaveAs dialog box.

Ajay
  • 18,086
  • 12
  • 59
  • 105
0

I had the same problem in VS 2008 and I resolved by getting rid of the duplicated .dll files in the compiling / debugging folders. Please refer to my full response here: https://stackoverflow.com/a/50063517/3603386

Simone
  • 1,418
  • 15
  • 22
0

Do you use F10 (step over) when debugging?

F9 is the shortcut to add/remove a breakpoint, you may be inadvertently hitting that.

Flater
  • 12,908
  • 4
  • 39
  • 62