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!

24 comments

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! 

0

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

0

Nathanael, thanks for the answer.

Please try clearing %LocalAppData%\JetBrains\Transient\ReSharperPlatformVs14\v05 folder.

Thanks! 

1

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#).

0

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.

0

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.

0

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! 

0

Having the same issue. Any resolutions? I'll create an ticket but seeing with VS 2015 Update 3 RC also.

0

Mine worked by clearing %localappdata%\JetBrains\Transient\ReSharperPlatformVs14\v05 as @Alexander suggested.

But after some time it again got disabled.

0

I saw this as well with 2015 Update 3 RTM. I deleted everything in %localappdata%\JetBrains\Transient\ReSharperPlatformVs14 and it started working again

0

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.

0

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! 

0

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! 

0

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.

0

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

0

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!

0

Same problem, I use R# 2017.1.3

0

Hello @Jmora!

 

Could you please check the following:

  1. is the issue reproduced with ReSharper 2017.2 latest EAP build - https://www.jetbrains.com/resharper/eap/;
  2. is the issue reproduced on a newly created solution;
  3. is there any other ReSharper functionality  also disabled.

Thank you.

0

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.

 

1

In my case it gets disabled when the updater proposes an update. I just have to skip it, and the menu gets enabled again!

 

0

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?

0

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.

0

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.

0

Thank you for the reply, Henry.

Please let us know if the problem occurs again.

0

Please sign in to leave a comment.