views:

644

answers:

5

I am having two issues with the debugger using visual studio version 9.0.30729.1 using .net 3.1

Issue one - I hit a breakpoint, and F10, F11 do not move me to the next instruction. If I repeatedly press F10 I will eventually step to the next instruction. I can place another breakpoint further down in the code and do an F5 to get to the next breakpoint - but I miss the ability to step.

Issue two - I hit my first breakpoint, do an F5 or F10 and the program continues without stopping.

These issues seem to occur semi randomly. Sometimes they clean themselves up if I shut down visual studio and reboot my computer - but not always. This does not occur as often in my unit tests as with the GUI application.

Any ideas will be appreciated.

+1  A: 

Make sure the source code hasn't changed after you've started a debugger...

Source code has not changed. I can do a full clean / rebuild and no change in behavior
John Chenault
+2  A: 

Do you have a great deal of threads in the program? Could be Thread 1 breaks, you step, thread 2 breaks at the same point that thread 1 just broke at

Matt Briggs
I do have a number of threads. But the thread I am breaking on is the GUI thread. (IE I am responding to a user action in the Gui). Not sure how another thread could get into that code
John Chenault
This has definitely happened to me. It seems odd to hit step and see yourself jump to a completely different line of code, but that's where another thread jumped to.
C. Ross
Oh - and I have see this inside of a lock statement - so it feels like something else
John Chenault
just for the fun of it, try turning on the current thread display in the toolbar. you are probably right that it isn't it, but it isn't that hard to be sure
Matt Briggs
+1  A: 

Just for giggles, try turning off just my code. Uncheck the "just my code ..." option under (Tools -> Options -> Debugger -> General)

JMC can cause odd behavior in scenarios you wouldn't necessarily expect.

JaredPar
A: 

Make sure your .pdb files are current, otherwise the source you're debugging and the source you're running might not match.

Chris Ballance
date on .pdb files seems to match the last build.
John Chenault
A: 

Try cleaning up your solution directory by deleting (renaming) all files generated by Visual Studio (*.ncb, *.suo, obj/, bin/, and maybe some more).

0xA3