Why does F10 (step over) in Visual Studio 2010 not

2019-06-15 07:51发布

问题:

I also tried 2 solution. But It doesn't worked.

  1. Go to Tools > Options menu in Visual Studio.
  2. Go to Debugging > General menu item in left pane.
  3. In right view you will see and option Step over properties and operators (Managed only). Uncheck this option and then you are all set.

and

  1. Go to Tools > Options menu in Visual Studio.
  2. Go to Debugging > General menu item in left pane.
  3. In right view you will see and option Enable Just My Code (Managed only). Uncheck this option and then you are all set.

回答1:

In the Options.Keyboard page, please select "Debug.StepOver" from the command listbox, and then put focus to the "Press shortcut keys" textbox and press F10, click Assign button to re-assign shortcut, does it work?

You can also try to run Visual Studio under safe mode, which will prevents all third-party VSPackages from loading when Visual Studio starts; if the issue disappear under safe mode, you may consider checking your installed add-ons or VSPackages.

Second, to log all activity of Visual Studio to a log file for further troubleshooting, please use the /Log switch, and post the log file content here, so we can do more investigation on it.

If this feature works well before, and suddenly behave abnormally, it usually indicate that some files or configurations of Visual Studio installation is corrupted or missed, you can:

  1. Restores Visual Studio default settings by using "Devenv.exe /ResetSettings" command. Please backup your settings before restore to default settings.

  2. Repair/reinstall Visual Studio;

To repair Visual Studio In the Add or Remove Programs dialog box, select Visual Studio then click Change/Remove.



回答2:

CamStudio application was the issue in my case.
Somehow it reserved this key to itself and Visual Studio was not able to use it anymore (I've tested it MS Word (Alt+F10 - was working as expected, while CamStudio was on - when minimized it appears only in SysTray)).
I've closed CamStudio and it was fine:
F10 functionality "reappeared" in VS2008.



回答3:

Turns out my issue was simpler/more embarassing, but I figured I'd post it just in case it helps someone else.

I had the F Lock (function key lock) turned off, so my F10 keypress wasn't being sent as such. With these newer keyboards (mine is an MS wireless keyboard), there are several modifier keys that affect the keyboard behavior.

Once I enabled F Lock, everything worked as expected.



回答4:

Similar to the last post, I had another application that was open. So make sure all third party software is closed. In my situation I had installed CamStudio (screen recorder software). The moment I closed it I was able to start using F10 key again.



回答5:

I also ran into this problem in Visual Studio 2012, and what fixed it for me was disabling .NET Reflector.



回答6:

Tools - Options - Environment - Keyboard

Search with "Debug.StepOver", check is the shortcuts for selcted comman was set to F10(Global), if not then set it you should get it work. If the setting is correct, then you may running some other program that has registered the F10 key as a glabol hotkey and make this fail, try to open as few program as you can see if you find that program, or just change it to another key



回答7:

I know this is an old issue, but it's one of the first search results for "Visual Studio F10 not working," so I wanted to post one possible solution here in case anyone else runs across this page with the same problem. My problem was caused by a very specific situation, so it might not work for everyone. The issue was the F10 shortcut simply was not working at all. Nothing happened when pressed. When I tried to reset the shortcut key for the Debug.StepOver, it wouldn't accept F10 as input.

SOLUTION: "Thaw" or uninstall Deep Freeze. I was using software called Deep Freeze to protect certain partitions on my hard drive. Unfortunately, Deep Freeze was protecting ALL of my hard drives, regardless of which drives I specified in the settings. When it was in "frozen" mode, it was causing crashes, hangs, and strange and erratic behavior in other programs including Visual Studio. When I rebooted in "thawed" mode, the problems went away and I regained the ability to F10 normally. Deep Freeze is commonly used on school and business computers, in which case you'd have to contact an administrator to deal with it, or alternately, set a different key combination for Debug.StepOver.

On a side note, also make sure that you're in DEBUG mode, not release mode, when trying to use F10 to step over.



回答8:

Hey I also encountered this problem. I was debugging a c++ project.

For people who still suffer from this problem, try changing the properties of "Devenv.exe" under the "Compatibility" tab to "Run as Administrator".

This solved it for me, I hope it works for you too.



回答9:

Issue Description:

Same issue as OP , but a little bit worse:

When I tried click any key in "Press shortcut Keys" here:

I couldn't use F10, but I could use Alt+F10

Resolve:

Turns out I had few shortcut on my desktop with shortcut set to F10.

all of the shortcuts added (probably) by some bloatware I've installed by mistake.

I have deleted these shortcuts. and had to restart Explorer.exe process.



回答10:

I had a similar problem on a Microsoft Ergonomic keyboard: F10 did not work as a step over for the debugger. Yet at the same time Fn-F10 worked on the Lenovo laptop. I found a resolution for the Microsoft Ergonomic keyboard: Press the Function lock key just to the right of F12. This is a toggle key that had the function keys turned off.



回答11:

Another very specific situation that could cause stepping to not work: I have been using VS for many years with no problem. All of a suddden, in one particular (new) file, I could not step using the debugger. Using the Step Over command on the menu or by pressing F10 was causing it to step out of the method. The culprit? The [DebuggerStepThrough] attribute! I had copied a simple class used to represent an object that was serializable to XML. It had the DebuggerStepThrough attribute on it, and I wondered about it for a moment, but then forgot about and coded away, making several copies of it to set up the classes that would provide the required XML structure. Then in one of those classes I added a method that had some actual meaty logic. That's when I discovered I couldn't step through it. I could set breakpoints on individual lines and the debugger would stop, but that was getting to be a nuisance. As I read through all the above solutions and didn't find anything helpful, I suddenly remembered seeing the [DebuggerStepThrough] attribute. Hope this helps someone else.