views:

418

answers:

2

Hi,

Big problem. I'm not sure what it was that I did, but it seems that I can no longer debug into functions.

It happens in no particular place, just all throughout the code. I set a breakpoint, and then try to "step over" in order to go to the next like of code. Now, the debugger seems to interpret that as "continue".

Even better! If I set a breakpoint right after that, the debugger ignores the breakpoint and just continues.

Any ideas as to what could be causing this? Debugging has become more or less useless to me at this point-- I'd consider this a catastrophic failure.

I've completely deleted my project and synced to source, so it's not a local user configuration issue. I've checked the debugger options, (Options-> Debugger) and I don't have anything unusual checked).

Any help is appreciated...

Edit: Shy's answer below is not correct. I'm doing all of those things correctly.

+2  A: 

quite a few possibilities
- Your compiling in release without debug symbols instead of in debug - Check which configuration you're compiling
- For some other reason you don't have debug symbols - check the settings
- The binary version you are running is not the same as the one which is being compiled - check which executable which is being run.

shoosh
It's in debug, with symbols. I have DEBUG constant on, TRACE on, optimizations off, unsafe code off. The working directory is the same as the debug build target.
mmr
A: 

Ah! I figured it out!

This may or may not be a bug in visual studio.

Suppose I have an enumeration of cases from 0 to 5. Suppose I then have a dictionary with the enumeration as a key and another integer as the value. If I then have a combo box with all the possible values in the dictionary as the contents of the dropdown, when I select the proper index, I can't just cast the integer back to the enumeration. For instance, if I have elements 4 and 5 in the enumeration in the dictionary, then use the Keys collection to create the dropdown list, when I get the combobox.selectedIndex property, the result is a 0 or a 1. That's not found in the dictionary, and so an exception is thrown.

That's how I found the bug. However, if instead of using a dictionary, I use a list of objects that contain (enumeration, integer) as the contents, then the incorrectly casted enumeration wasn't being found, but the code kept going. Rather than throw an exception (and I'm not sure which one should have been thrown), it appears that someone the IDE stepped on itself.

When I implemented the dictionary version above, the exception was thrown, and once it got fixed, I could debug again.

mmr