Refactor Menu disabled (VS2015)
Answered
Hello,
I'm using Visual Studio 2015 (14.0.25123.0) and ReSharper Ultimate 2016.1. Both worked until yesterday. Then I tried using the Ctrl+R R to rename which gave me the error message "The key combination (Ctrl+R, Ctrl+R) is bound to command (.Refactor.Rename) which is not currently available."
The right click menu shows a disabled Refactor menu:
So does the top menu:
Things I tried:
- Restarted VS / Windows
- Updated Visual Studio
- Updated Resharper
- Repaired Resharper
- Reset all settings (via Import and Export Settings Wizard)
Do you have any idea what I could have missed?
Thank you very much!
Please sign in to leave a comment.
Hello Nathanael,
Do you have other R# features in the text editor like code highlighting, error/warning/suggestion squiggles, marker bar next to vertical scrollbar?
Does it affect such particular solution only?
Thanks!
Hello Alexander,
the other ReSharper functions don't seem to work either – I don't get any tips or warning on bad code. It affects every solution I've tried (which are three)
Thanks
Nathanael, thanks for the answer.
Please try clearing %LocalAppData%\JetBrains\Transient\ReSharperPlatformVs14\v05 folder.
Thanks!
Hello,
sadly this didn't help. But I tried loading another project; ReSharper worked there without problems. So it seems to be a problem of the three solutions I use most. (And the only ones I opened before updating VS and R#).
I've had almost the exact same experience after installing Update 2 (VS Enterprise 2015).
Every solution I opened had the problem of ReSharper menus (Refactor and Navigate) - whether in the tool bar or context menus, was disabled - hot keys also did not work. I tried the same things @Nathanael attempted, but none of that worked for me either.
Before trying Alexander's suggestion, I closed all running instances of VS 2015, then deleted everything in %LocalAppData%\JetBrains\Transient\ReSharperPlatformVs14\v05
It works now! Thanks all. I've spent a few days tinkering before finding this thread. I thought a complete uninstall / reinstall would resolve any issues like this, but it's good to know where the caching issues are.
Seems like a thread like this has existed for virtually every version of VS and ReSharper. Maybe ReSharper > Options > General > Clear Caches could also clear out these folders as well? I had instinctively tried that button but it didn't fix this issue.
I take it all back ;)
This issue is not resolved by Alexander's suggestion. Clearing that directory enabled the ReSharper Refactor menu briefly (< 5 seconds). I was able to run "Adjust Namespaces" on a folder, but once the cache files are written again, the menu is grayed out an all shortcuts cease to function. Clearing the menu and restarting VS2015 will give you another 5 seconds or so to use ReSharper.
I will open a new post for this since this one is already marked as answered.
Hello Matthew,
Please use "Submit a request" button above to create a support ticket instead of adding a new forum thread.
In the request, please attach a R# log file (run Visual Studio with the following command line: 'devenv /ReSharper.LogFile C:\log\resharper_log.txt /ReSharper.LogLevel Verbose' and reproduce the issue).
Thanks!
Having the same issue. Any resolutions? I'll create an ticket but seeing with VS 2015 Update 3 RC also.
Mine worked by clearing %localappdata%\JetBrains\Transient\ReSharperPlatformVs14\v05 as @Alexander suggested.
But after some time it again got disabled.
I saw this as well with 2015 Update 3 RTM. I deleted everything in %localappdata%\JetBrains\Transient\ReSharperPlatformVs14 and it started working again
I am running into this same issue on a brand new install of ReSharper 2016.2 with Visual Studio 2015. Removing the above directory seemed to fix the problem but as Nikhil noticed after a few minutes the problem resurfaced.
Is there a long-term solution for this?
Thanks.
Hello Jesse,
Please submit a support request ("Submit a request" button above) and attach a ReSharper log file (run VS with parameters 'devenv /ReSharper.LogFile C:\log\resharper_log.txt /ReSharper.LogLevel Verbose' and reproduce the issue).
Thanks!
Hello Guys,
If you experience disabled Refactor menu item in R# 2016.2 or R# 2016.3 EAP builds and it happens in Portable Class Library or in a solution with .NET Core projects, we reproduced similar issue (e.g. https://youtrack.jetbrains.com/issue/RSRP-462100) and it will be fixed in R# 2016.3 release build.
Thanks!
Anything new on this? I just got .3 and have several projects, with no different settings than my others, where the Refactor menu item is grayed out. Do you write a log of what tells the SW to gray that out. Obviously it's getting the info from somewhere.
I take that back. EVERY project has Refactor disabled. Everything was fine all morning yanking strings out of XAML. Then I went to CTLR-O and it said that command was not available out of nowhere. I thought it was because I changed active project but they all fail. I though it worked because after I change active project the Refactor menu is enabled - but - as another reader said - for 5 seconds.
What are the conditions that cause that to get grayed out? I'm spinning my wheels here...
So, I had the very same problem, and came to realize this was because for some reason, "lightweight" loading was activated for my current solution...
In case this is active for yours, right-click the solution in VS's Solution explorer, and click "disable lightweight loading" at the bottom!
Same problem, I use R# 2017.1.3
Hello @Jmora!
Could you please check the following:
Thank you.
One thing everyone seems to have missed is that if you have a DLL reference to another project but that project's source code is not in the current solution, Visual Studio will show the source code for methods, etc., is that DLL, but ReSharper won't allow you to refactor that code. To refactor that code, you must either import that project into the current solution or you must launch a second instance of Visual Studio and open the project in question and refactor/rename from there.
In my case it gets disabled when the updater proposes an update. I just have to skip it, and the menu gets enabled again!
Hi @all,
I'm running into the same problem - except that I use VS2017 and R# 2017.2
It seems that I can refactor classes but not interfaces, though.
Contents of %LOCALAPPDATA%\Jetbrains\Transient\ didn't even show VS2017, so there was nothing to delete.
Any advises?
Hello Henry!
Could you please specify what's happening when you trying to refactor interface, is there any error?
Some screencast illustrating the problem will be highly appreciated (e.g. using https://www.techsmith.com/jing-tool.html)
Thank you.
It happens simply nothing. As before the menu entry is disabled and therefore grayed out. But somehow it now works again. Updated to R# 2017.2.2 today. Maybe that solved the issue somehow.
Thank you for the reply, Henry.
Please let us know if the problem occurs again.
same here
VS 2019 19.4.1
R# 2019.2.3
not that the refactor and navigator menus are greyed out, but most of features ... even the "About JetBrains Resharper Ultimate" menu which is enabled does not do anything !
clearing .vs and %LocalAppData%\JetBrains\Transient does not help either
Hello @...
Could you please let us know if the problem is reproduced in a newly created solution?
Could you please also run Visual Studio with the following command line: 'devenv /ReSharper.LogFile c:\log\resharper.log /ReSharper.LogLevel Verbose', reproduce the issue and send us a corresponding 'resharper_log.txt' file. You can share it privately via "Submit a request" form.
Thank you.
I am seeing the same issue with the Refactor menu - it is disabled even after following the guidelines to clear the contents of the transient folder? Has any resolution been found for this issue?
Hello Rgovindarajan,
Could you please specify if the problem is reproduced in a newly created solution?
Please also provide a screenshot of VS window demonstrating the problem.
Thank you.
Hello Angelina
I created a new solution – without adding a class, and the menu is enabled. The moment I add a class to the solution, the menu becomes disabled (the default class that gets created with the solution and first project does not pose this problem). If I remove the class, the menu becomes re-enabled again (see second image). I am using Visual Studio 2019 Professional 16.5.4, and this is a .NET Core project.
Hello @Rgovindarajan,
Unfortunately, code context cannot be seen on the screenshot.
Could you please specify for what code member you are trying to envoke refactoring?
Thank you.