Ctrl+R, Ctrl+R command not working

谁说胖子不能爱 提交于 2019-12-03 06:26:10

问题


I'm attempting to use the Ctrl+R, Ctrl+R command within Visual Studio 2008 to rename a variable. I get an error message at the bottom saying that

"The key combination (Ctrl+R, Ctrl+R) is bound to command (&Rename...) which is not currently available."

I am not running it or anything I can think of which might prohibit modifications of the file and the F2 command allows a rename to happen. Anyone know how to fix this?

EDIT: I do have Resharper installed but was previously able to do this with the same setup, I recently migrated computers.


回答1:


I was able to fix this by doing the following:

  1. Go to ResharperOptions menu commmand
  2. Select EnvironmentKeyboard & Menus
  3. Select the Visual Studio option under Keyboard Shortcuts
  4. Click Apply Scheme and Save

This will cause Ctrl+R, Ctrl+R to do a rename. (Select ReSharper options in the dialog box that pops up then.)

However, it made F2 no longer able to preform a rename. I was able to fix that by doing the following:

  1. Go to ReSharperOptions menu command
  2. Select EnvironmentGeneral
  3. Select the ReSharper 2.x or IntelliJ IDEA under Restore ReSharper keyboard shortcuts
  4. Click Apply or OK

This allows both F2 and Ctrl+R, Ctrl+R commands to work for renaming a variable.

This seems to be specific to ReSharper being installed with Visual Studio, I don't know what the solution would be to fix this if ReSharper weren't installed.




回答2:


For Resharper 6

You should:

  • Select menu "Resharper" - "Options..."
  • Select "Visual Studio Integration"
  • Choose "Visual Studio" in both places
  • Click "Apply Scheme"

It will either works or you will have a selection to do (Visual Studio or Resharper), if it is so, then choose Resharper.




回答3:


resharper has multiple default shortcut bindings that is chosen the first time you start visual studio after instalation. My guess is you picked a different one this time.




回答4:


In my case the problem was solved by clearing the ReSharper cache. This can be done in the options menu under Environment > General here:




回答5:


This happened to me once. I had to reinstall Resharper (repair from Add/Remove programs probably) to get it to work. But that was with VS2005 though.




回答6:


Using version 8 of ReSharper in Visual Studio 2013, I had to

  1. Go to the RESHARPER menu -> Options
  2. Expand Environment
  3. Select Keyboard & Menus
  4. Choose Visual Studio as the ReSharper keyboard scheme
  5. Click Apply Scheme...Save & close dialog box.

The next time I executed a keyboard shortcut it prompted me to choose which keyboard shortcut I wanted to use.




回答7:


You get this behaviour in Visual Studio (without R# installed) if the editor window does not have focus when you issue the shortcut. I've just tried it with R# installed and it does the same thing.

Give the editor focus (ie. by clicking in it) and try again.




回答8:


This is usually the shortcut used by Resharper. Is there any chance Resharper is not running?

Alternatively, you can change the name, hit Ctrl+. and then use Rename.




回答9:


For DevExpress:

  • Open the Options screen (Ctrl+Alt+Shift+O)
  • Go to CoreFeatures
  • Set Default to Visual Studio shortcuts



回答10:


For me, this problem was caused by me not clicking 'Accept" on the terms and conditions page, but closing it. I did not realize it was the terms and conditions, and thought it was just a notice, or a 'readme' being displayed.




回答11:


All the answers above are well and good but this error also comes up in one more instance.


You start debugging your test script written for the project , the project stops at breakpoint .

If at this point , you try any operation on code , you will get the error similar to : "The key combination (Ctrl+R, Ctrl+R) is bound to command (&Rename...) which is not currently available."




回答12:


Restart Visual Studio.

Worked for me.




回答13:


Nothing has worked for me until I have tried upgrading my Resharper! :O




回答14:


None of the above worked for me. I had to reset my resharper settings in the end.

  1. Go to Resharper -> Manage Options
  2. Click the "Reset All Settings" button


来源:https://stackoverflow.com/questions/2547915/ctrlr-ctrlr-command-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!