Ctrl+R, Ctrl+R command not working - c#

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.

I was able to fix this by doing the following:
Go to Resharper → Options menu commmand
Select Environment → Keyboard & Menus
Select the Visual Studio option under Keyboard Shortcuts
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:
Go to ReSharper → Options menu command
Select Environment → General
Select the ReSharper 2.x or IntelliJ IDEA under Restore ReSharper keyboard shortcuts
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.

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.

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.

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

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.

Using version 8 of ReSharper in Visual Studio 2013, I had to
Go to the RESHARPER menu -> Options
Expand Environment
Select Keyboard & Menus
Choose Visual Studio as the ReSharper keyboard scheme
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.

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

I'm guessing very few people will be in my situation but FWIW I was in this situation too where Refactor.Rename (Ctrl+R,Ctrl+R) was NOT working in Visual Studio 2019/Win 10, after reboots/restarts plus I did not have Resharper installed. In my case Refactor.Rename wasn't working because my project was in FOLDER mode not SOLUTION mode (OMFG). Soon as I used the solution tool to "Switch Views" and went into SOLUTION mode Refactor.Rename started working again. In hindsight this makes sense of course but some kind of error message/warning would have been nice to help me realize what the issue was!

For me, the issue was I hadn't started the Resharper evaluation which wasn't obvious because all of the Resharper extension options were accessible, but the clue was under:
Extensions -> Resharper -> Why Resharper Is Disabled.
Click "Start Evaluation" (in the same location as "Pause Evaluation" in the screenprint)
I expected the evaluation to start when I clicked "OK", but clearly it doesn't.

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.

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.

For DevExpress:
Open the Options screen (Ctrl+Alt+Shift+O)
Go to Core → Features
Set Default to Visual Studio shortcuts

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.

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."

Restart Visual Studio.
Worked for me.

None of the above worked for me. I had to reset my resharper settings in the end.
Go to Resharper -> Manage Options
Click the "Reset All Settings" button

In my case (Visual Studio 2022 17.4.0 with Resharper 2022.2.2), I had to
disable Resharper
restart Visual Studio to make the change effective
enable Resharper
restart Visual Studio to make the change effective

Related

Visual Studio 2022 not showing syntax errors and Intellisense is not working properly

Working on a project I made a class with properties and when I tried to auto-generate a class constructor I got an error saying something on lines of "auto generation of class constructor failed... and will be disabled" and ever sense then the "generate constructor" option has been taken off the Refactor menu and on top of that I don't get syntax error highlighting anymore and intellisense doesn't seem to be working proper or at all.
I tried using going into Tools > Options > Text Editor > various fields including "C#" and "general") and I don't see anything obviously wrong. I also tried to use Visual Studio Installer to try to repair and that didn't do anything. I am completely out of ideas and I can't find anything that is remotely close to my case. TIA
I can't add this reply as a comment as I don't have 50 reputation.
I created a .Net 6.0 C# console project in Visual Studio 2022, add a class, and add two private fields. Selecting these two fields, press Alt+Enter to quickly generate the constructor. I did not encounter your issue.
Please try:
Go to Visual Studio Installer, click Modify, uncheck IntelliCode in Individual components, then click Modify button to save the change, wait for the installation to complete, and then reinstall IntelliCode.
In Visual Studio, go to Tools->Options->IntelliCode to check if the setting is Default.
Go to Tools menu, and select Options. Under Intellicode select General. Just uncheck “C# Suggestions”. Then restart Visual Studio and check that intellisence and syntax errors are appearing.
Note, I was not able to figure out what this option does, as the C# code suggestions seemed to continue to work as expected.

Visual Studio doesn't show me the red squiggle Intellisense errors [duplicate]

My Visual Studio (2008) Editor has stopped to underline Errors (this nifty wavy red lines). I can't really tell when, but it can be related to the installation of .Net Framework 3.5 SP 1 or the MVC Beta (which I guess is unlikely). Furthermore have I installed and uninstalled both CodeRush and Resharper for evaluation purposes (decided not to keep either one of them).
Does anyone know the problem and how to restore this functionality again?
Have you checked Tools→Options...→Text Editor→C#→Advanced→Underline errors in the editor?
I usually like to reset my settings after messing around with plugins, as they tend to mess with settings: Tools→Import and Export Settings...→Reset all settings.
About possible causes.
For VS 2012 and 2013 if you have more than one instance of Visual Studio on different machines binded to one "live" account and have installed ReSharper on one of them, it disables the native IntelliSense and error underlines (to replace by it's own rules) that will be synchronised through your account to another machine without ReSharper.
Found it in Visual Studio 2019 as: Tools > Options > Text Editor > General > Show error squiggles
This is generally called Disable Squiggly or Wavy lines in Visual Studio.
How you will do in Visual studio 2013?
TOOLS -> Options... -> Text Editor -> C/C++ -> Advanced -> Disable Squiggles: True/False (Under IntelliSense) -> Press OK
I know its an old question, and with various solutions, but I have fixed it in different way. I'm working with Unity3D on my C# code using VS2017, when suddenly VS decides to stop underlining error while im typing. However, if I close the file tab and reopen, it suddenly undelines the error.
For example:
class A {
public int x;
s;
}
should obvsiouly give an error for that lonely 's' symbol. But, VS doesn't underline it until I close and reopen this file tab.
Solution:
Copied the entire Unity Project folder (which is like a regular VS Solution folder basically) and worked with the new folder, which issue was gone there.
For visual studio 2017 act according to HeeJae's comments in:
https://developercommunity.visualstudio.com/content/problem/113112/design-time-error-checking-isnt-working.html
i.e:
Hi. you are probably hitting a known issue. can you try this?
1.Update to latest release If that doesn’t solve it
2.Go to Tools\Options\Projects and Solutions\General and uncheck “Allow parallel project initialization”.
3.Close VS.
4.Delete the “.vs” directory beside their solution file.
5.Reopen VS.
..
thank you
You can re-enable the "Allow parallel project initialization" option after the issue was solved.
I tried to upgrade VS, reset VS settings, clear VS cache and everything people do conventionally but none of them solved this issue! At the end the mentioned solution worked for me magically.
Good luck
Unloading and loading same project again from the solution does the trick. Just right click on the project and click "Unload Project". Once unloaded, again right click the same project and click "Reload Project". Error highlighting will return.
I had the same issue with 2017. There was a 'disable intelisense' option, make sure that is set to false.
For everyone wondering in 2021..
search for "C_Cpp.errorSquiggles" in the settings.
Make sure to have it active for the user, as well as the workspace.
No need to restart Visual Studio.
For me (VS 2019) , after trying the other answers also, setting the scope of analysis from "Current document" to Open document" brought back the missing error markers
Just go to settings and search for errors and Image in Error Squiggles. You can see the Error squiggles (Modified: Workspace - Right now you can't see it because I modified it). Just click on modified and you will see the disabled option. If by mistake you disabled it, just enable it and you can see the red line errors again in your code.
In latest edition, check for .vscode folder in same project folder. There will be a setting.json file in that. Delete the key value pair of "C_Cpp.errorSquiggles": "Disabled". Restart the vs code.

VS2015 update 2: "Initialize Interactive with Project" option missing

According to the Visual Studio 2015 update 2 release notes, it is now possible to initialize the C# interactive environment with the context of a selected project. This feature is further described in these blog posts. However, the "Initialize interactive with project" menu option they talk about and show in screenshots simply isn't present for me (though I do see the related new "Execute in interactive" option when I select code in the editor).
I'm using:
Any clue what might be wrong? Does anyone else see this feature?
Update: Just to prove it's really not there:
Right click on your project and you'll see the option in the context menu.
Within the code window Right-Click you will see it there. Perform the right click as if you are trying to right click on a function. You can execute an entire function.
You can actually right click anywhere in the code window.
I'm using Visual Studio Community 2015 Update 2, and I can see the expected menu option by right-clicking a console project, so it should be available for you too.
I just wonder if you can see and use View > Other Windows > C# Interactive
Maybe if you double check the installed components through the Visual Studio setup and/or do a Repair by Visual Studio setup can bring it back for you.

Crtl+Shift+Space shortcut in Visual Studio 2015

I started use Visual Studio 2015. In prev version I use Ctrl+Shift+Space shortcut to display Parameter Info, but in current version it not working.
How can I restore it, what is name for this shortcut in keyboardconfiguration?
I had the same issue, got it working by doing this:
Go to Tools > Options > Text Editor > All Languages > General, Statement Completion check Parameter Information (like most of the options in the General dialog, it was a full black box by default).
Ref:
https://msdn.microsoft.com/en-us/library/vstudio/ecfczya1(v=vs.100).aspx
It is called Parameter Info, or as it appears in the list: Edit.ParameterInfo
The default shortcut is: Ctrl+K, P
So give that a try. It also binds to Ctrl+Shift+Space in VS 2012/13 as you have mentioned.
It is supposedly supported in VS 2015 too so not sure why it isn't working for you - I seem to recall reading something on SO the other day that was causing shortcut problems, I think it was something to do with keyboard language settings, but I can't seem to find a reference at the moment so don't quote me on that!
For a full list of shortcut keys, see these references: VS 2013, VS 2015
You can search for example "Space" and it's not hard to find the one you wanted.

Visual Studio C# IntelliSense not automatically displaying

Just recently, my Visual Studio 2010 stopped displaying IntelliSense suggestions automatically while I am typing. I can still press ctrl+space to get it to work, but it doesn't automatically show a list of suggestions like it used to. I have already tried disabling all my extensions, restarting VS and the computer, and I have checked all the appropriate settings (Options -> Text Editor -> C# -> IntelliSense) to make sure that it is set to offer suggestions after a character is typed.
Has anyone seen this behavior before? Does anyone have any other suggestions for how I can get IntelliSense to go back to the way things were before? If not, I might just have to do a fresh reinstall of VS...
In prose, in case you can't see the above image:
Open Tools > Options > Text Editor. If you're only having this issue with one language, find that language; if it's for everything, click "All Languages". Right at the top, there'll be a few options labeled "Auto list members", "Hide advanced members", and "Parameter information". Make sure all of those are enabled (though the second may be disabled; if so, ignore it).
I have found that at times even verifying the settings under Options --> Statement Completion (the answer above) doesn't work. In this case, saving and restarting Visual Studio will re-enable Intellisense.
Finally, this link has a list of other ways to troubleshoot Intellisense, broken down by language (for more specific errors).
http://msdn.microsoft.com/en-us/library/vstudio/ecfczya1(v=vs.100).aspx
I'll start off my noting that this hasn't happened since I upgraded my RAM. I was at 4GB and would often have multiple instances of VS open along with SSMS. I have since gone to 8GB and then 16GB.
Here's the steps I go through when I lose intellisense.
If only one file/window appears to be affected, close/reopen that file. If that doesn't work, try below.
In Visual Studio:
Click Tools->Options->Text Editor->All Languages->General
Uncheck "Auto list members"
Uncheck "Parameter information"
Check "Auto list members" (yes, the one you just unchecked)
Check "Parameter information" (again, the one you just unchecked)
Click OK
If this doesn't work, here's a few more steps to try:
Close all VS documents and reopen
If still not working, close/reopen solution
If still not working, restart VS.
For C++ projects:
MSDN has a few things to try: MSDN suggestions
The corrupt .ncb file seems most likely.
From MSDN:
Close the solution.
Delete the .ncb file.
Reopen the solution. (This creates a new .ncb file.)
Notes:
This issue does not appear to be specific to C# as C++ and VB users
report the same issue
Tested in VS 2013/2015
Steps to fix are:
Tools
Import and Export Settings
Reset all settings
Back up your config
Select your environment settings and finish
I also faced the same issue but in VS2013.
I did the below way to fix, It was worked fine.
Close all the opened Visual studio instance.
Then, go to "Developer command prompt" from visual studio tools,
Type it as devenv.exe /resetuserdata
Restart the machine, Open the Visual studio then It will ask you to choose the development settings from initial onwards, thereafter open any solution/project. You'll be amazed.
Hope, it might helps you :)
Deleted the .suo file in solution folder to solve the problem.
Sometimes i've found Intellisense to be slow. Hit the . and wait for a minute and see if it appears after a delay. If so, then I believe there may be a cache that can be deleted to get it to rescan.
I hit this today after the following sequence:
Added a new class to my project.
Closed Visual Studio, but accidentally selected No when it asked if I wanted to save changes.
Reopened Visual Studio, and found that it reopened the new file automatically but without my previous changes (as expected). However, IntelliSense was no longer working in the new file.
The problem was in addition to not saving changes to the new file, it didn't save changes to the project, so after reopening Visual Studio the file was not part of the project. The Show All Files command in Solution Explorer, or Add → Existing Item..., resolved the problem.
I had the file excluded from the project so i was not able to debug and have intellisense on that file.
Including the file back into the project solved my problem! :)
A new cause for this in the .net core era is having a project loaded for an unsupported .net core version. For instance if you loaded a project from GitHub that was set to use:
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
</PropertyGroup>
But you only have 2.1 installed or find yourself using Visual Studio 2017 then the compiler wont be able to find the SDK code and thus provide intellisense.
The solution in that case might be to right click on your project and select Edit MyProject.csproj from the context menu and change the target framework as necessary:
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
</PropertyGroup>
This assumes whatever project you loaded can actually be run under a lesser target framework.
I simply closed all pages of visual studio and reopened ..it worked.
Deleting the .vs folder in the solution solved my issue. You have to exit from Visual Studio and then delete the .vs folder and start Visual Studio again.
Closed all my VS windows
Started the Visual Studio Installer and clicked 'Modify'.
Under 'Individual components' > 'Code Tools' > Deselected NuGet package manager and re-selected it.
After modifying and restarting VS, IntelliSense was working correctly again.
Found my answer on https://developercommunity.visualstudio.com/content/problem/130597/unity-intellisense-not-working-after-creating-new-1.html
[Tools -> Options -> Text Editor -> All Languages -> CodeLens]
Check if check box "Enable CodeLens" is checked
I have just come to about this problem while installing one of the extensions and its file was deleted by my anti virus so I just disabled my anti virus and reinstalled visual studio. Suggestions are working properly without any changes made after installation.
At the bottommost right look at the blue line where Ln, Col, Spaces, UTF, CRLF,..... here the language is specified.
Check that your language and the language specified there are the same.
In my case, it was Django Python while I was trying to use HTML.
This may be due to the solution configuration changed to Release Mode instead of debug. Right click on solution -> Properties -> Configuration Properties -> Set Configuration To Debug if it is in Release.

Categories