2

It is wild. I have not set a break point in the code, however it stopped at the line that was no break point. Let me demo this in a C# console application project.

demo

When I clicked F5, it stopped at line 29. Clicking it again, then stopped at line 33....

The debug option is:

step2

UPDATED

It could load an irrelevant symbol file. See below. How to disable it?

symbol

7
  • Just to be sure: your program compiled before you ran it? Or is it possible you run an older build and have newer source code? Commented Feb 6, 2014 at 19:28
  • I clear the solution and rebuild it, still wrong.
    – user1108948
    Commented Feb 6, 2014 at 20:07
  • Are you sure you are using the correct file? If you turn off check sum matching VS will display this behavrio because it only matches on file name which can easily lead to using eralier versions of the file
    – JaredPar
    Commented Feb 6, 2014 at 21:28
  • Sorry I am not following you. I just copied and pasted code, it is same as manually typing code.
    – user1108948
    Commented Feb 6, 2014 at 21:39
  • Do you build and run a Debug configuration? Open the Modules window (Debug -> Window -> Modules), check path to your loaded program and symbol file of program. Probably there have been loaded the wrong symbol files. Commented Feb 7, 2014 at 10:14

2 Answers 2

2

VS sometimes does not correctly remove its breakpoints. The solution is to use debug > remove all breakpoints.

0

Make sure you don't have a directory configured in the Cache symbols directory. Go to Tools > Options > Debugging > Symbols. If there is a directory that already set automaticly, shut down visual studio and delet it (or rename it if you wanna roll back from some reason). It worked for me. Dan.