Refactor menu missing from Visual Studio 2015

Visual StudioRefactoringVisual Studio-2015

Visual Studio Problem Overview


I am having trouble finding the right-click context menu in Visual Studio 2015. I know that nothing is wrong with my project or the file I am working. I can find the right-click context refactor menu in Visual Studio 2013. However, in Visual Studio 2015 there isn't a refactor context menu in the right-click context menu.

Where did it go? How do I get it back?

Your suggestion cannot include menu EditRefactor.

I have tried to reset my Visual Studio settings back to default using menu ToolsImport and Export Settings and that didn't bring the menu back either.

Visual Studio Solutions


Solution 1 - Visual Studio

Some of the refactoring tools have been relocated or are at least accessible in a different manner than they were previously.

Using the extract method refactor as an example, you can still use this function; it is just not done the same as before:

Select parts to extract

Right click

Right click

Quick actions

Quick actions

Click extract Method

Click extract method

I think they've changed it to feel more "ReSharper"ey. All of the functionality should still be there however.

Here's more information on refactoring in Visual Studio 2015 - hopefully this helps! Refactoring (C#)

Solution 2 - Visual Studio

You no longer need to access the refactoring using the mouse right click.

It is recommended that you use the keyboard shortcut keys within Visual Studio.

For all possible shortcut keys, see Default Keyboard Shortcuts in Visual Studio, Refactor.

Solution 3 - Visual Studio

You might need to build the project to get it to work.

See Code Editing ASP.NET Web Forms in Visual Studio 2013 | Microsoft Docs. (If it is missing then the point is that I am using an example provided by Microsoft.). In Refactoring and Renaming see To extract a method in a C# page. When I follow the instructions I cannot find the feature to extract the code to a method. When I tried the Edit menu it said I did not have valid code. Then I built the project and the feature to extract the code was available and worked.

Solution 4 - Visual Studio

If you change the name of the object you are refactoring, the light bulb then appears to the left which asks if you wish to change the name of the object (i.e. refactor) or generate a new constructor for the new named object.

Solution 5 - Visual Studio

Ctrl + . is the shortcut key for extracting a method in Visual Studio 2015 and onward.

Ctrl+M, R does not work anymore in new versions.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionMr. YoungView Question on Stackoverflow
Solution 1 - Visual StudioKritnerView Answer on Stackoverflow
Solution 2 - Visual StudioAshraf SadaView Answer on Stackoverflow
Solution 3 - Visual StudioSam HobbsView Answer on Stackoverflow
Solution 4 - Visual StudiodaveView Answer on Stackoverflow
Solution 5 - Visual StudioSohaib YahyaView Answer on Stackoverflow