F12不再在 VisualStudio 中工作

这快把我逼疯了。自从我安装了 ReSharper 4,F12似乎不再工作。如果你看到所有的 ReSharper 快捷方式在 Goto 子菜单声明没有任何指定!

进入声明的唯一方法是使用 Alt`,然后选择“声明”。

我尝试过卸载和重新安装 ReSharper,但是没有成功,我也尝试过,在 ReSharper 选项中要求它使用默认的 Visual Studio Key Bindings,但是这也不起作用。

有趣的是,当我使用 Alt`时,我实际上得到了 Declaration 选项的两个条目。

有人遇到过这个问题吗?

我正在使用 VisualStudio2005SP1。

78112 次浏览

I have had a few occasions where Resharper and Visual Studio keybindings got mixed up and I had problems sorting them out.

If it is only one or two bindings you care about then you can change them by going to the

Tools->Customize->Keyboard menu option.

I ran into the same issue and resolved it by first resetting my Visual Studio keyboard mappings:

Tools > Options > Keyboard > Reset

Then going into the ReSharper options and applying the scheme:

Resharper > Options > Visual Studio Integration > Apply Scheme

Update:

For VS2017 onwards:

Tools > Options > Environment > Keyboard > Reset

For Resharper 2017.2:

Resharper > Options > Environment > Keyboard & Menus > Keyboard Shortcuts > Apply Scheme

For ReSharper 8 and Visual Studio 2012:

Tools > Options > Keyboard > Reset

Then going into the ReSharper options and applying the scheme:

Resharper > Options > Environment > Keyboard & Menus > (Select Visual Studio under Keyboard Shortcuts) > Apply Scheme > Save

I ran into this problem after an organizational change that caused my windows profile to change. I tried the solutions listed above, but nothing seemed to work. Here is how I fixed it (brute force worked!)

NOTE: Steps listed are for VS 2012 and ReSharper 7.1.3

  1. Uninstalled Re-Sharper
  2. Exit visual studio, ensure the process devenv.exe is no longer there in the running processes (was there in my case and I had to do a "End Process Tree" from Task Manager)
  3. Fired up VS 2012, and from the menu Tools -> Options -> Environment -> Keyboard selected Visual C# 2005 (or any other setting you love) and pressed Reset
  4. Shutdown VS again (and ensure devenv.exe has been killed in Task manager)
  5. Re-installed re-sharper

Best of luck!

I had this issue in VS2015 using Resharper 9.1.3, I tried Ryan's answer but it still didn't work.

  • After doing the steps Ryan outlined, I clicked F12 where Resharper asks What do you want to do?, I select Use Visual Studio commands. Still doesn't work.
  • Tools > Options > Keyboard > Select ReSharper.ReSharper_GotoNextHighlight from command list box
  • Change Shortcuts for selected command to F12 (Text Editor), click Remove and OK.

After this it works!

I had the same problem with VS2013 and Resharper 9. I have a code like this:

gridList.Method1();
gridList.Method2();

I then right-click on any of gridList and click Find Usages (or just use Shift+F12) but it says "Usages not found" even though it is just one line away! Sometimes VS restart would help, sometimes it wouldn't. It looks like clearing the cache of Reshaper helps though: Resharper -> Options -> Environment -> General -> Clear Caches. This needs VS to be restarted, but then it started working as expected.

I had this problem and it was resolved by following the steps described in the picture:

Open Visual Studio Tabs on the path: Tools>>Options>>Keyboard

enter image description here

Open Visual Studio Tabs on the path: Resharper>>Options>>Keyboard & Menus and Do the following:

enter image description here

And Then Reopen the path above and do the following:

enter image description here

Finally, close the Visual Studio and open it.

It is possible that you have enabled Fn mode (Blue Keys) on your keyboard which overrides default behavior of functional keys including F12.

These steps solved it for me:

  1. Uninstall keyboard in Device Manager
  2. Re-insert your keyboard usb

"Web Essentials" Add or update visual studio "Web Essentials" You can find it at: Menu>>Tools>>Extensions and Updates

I hope this will save your time. It worked for me.

Web Essentials

ReSharper added a crap 'good' new thing that they now call a feature: Smart Go To Declaration. As dumb as it may sound, it comes enabled by default: crap 'good'.

The feature is described on the link provided from here but honestly at least it should've keep it disabled, not reinvent the wheel. It also tells you how to disable that crap 'good' feature.

Sometimes it has noting to do with Visual Studio at all. Be sure your keyboard has its function key setting of the keyboard itself to send the F12 function to Visual Studio. It is an easy thing to miss.

I had just installed Pulover’s Macro Creator and F12 was set as the global hotkey to pause a macro. It was intercepting the keypress before it had a chance to get to VS.

Solution is to change that hotkey to something else. I chose Ctrl-F12. The input box is on the top right of the Pulover window.

After changing the hotkey

My problem was that I couldn't use the command "Alt + F12" when trying to "peek definition" in Visual Studio. I found out through another forum-thread that it was Nvidia's GeForce Experience that overrides some of the "Alt" shortcuts and uses them for their functionalities with screen recordings etc.

What solved it for me, was going into the GeForce Experience settings and switch off the use of in-game overlay:

enter image description here

Alternatively, if you want to use the overlay, you can just change the short cut commands.

Update 2020. I had the same problem and also tried a lot of ways, but that was still didn't working... [VS 2015, ReSharper 2019.3.1] But, like Andrius said: Resharper -> Options -> Environment -> General -> Clear Caches. This needs VS to be restarted, but then it started working as expected.

Summary is: (try steps above) + Resharper..-> Clear Caches + VS restart. Hope this will be useful

Try simple way to enable it, press Fn + Esc key of the keyboard.

For ReSharper Ultimate 2017.3.3 and Visual Studio 2017: Tools > Options > Tools > External Sources > Default Visual Studio Navigation > Saveenter image description here