How can I disable ReSharper in Visual Studio and enable it again?

不羁的心 提交于 2019-12-27 11:50:50

问题


I installed ReSharper, and it works in Visual Studio, but how can disable it?

Whenever I search in the ReSharper menu I can't find a disable option.


回答1:


You can disable ReSharper 5 and newer versions by using the Suspend button in menu Tools -> Options -> ReSharper.




回答2:


If you want to do it without clicking too much, open the Command Window (Ctrl + W, A) and type:

ReSharper_Suspend or ReSharper_Resume depending on what you want.

Or you can even set a keyboard shortcut for this purpose. In Visual Studio, go to Tools -> Options -> Environment -> Keyboard.

There you can assign a keyboard shortcut to ReSharper_Suspend and ReSharper_Resume.

The Command Window can also be opened with Ctrl + Alt + A, just in case you're in the editor.




回答3:


Bind ReSharper_ToggleSuspended to a shortcut key.

Steps:

  1. Tools>Options
  2. Click Keyboard on the left hand side
  3. Type "suspend" in the "Show commands containing:" input box
  4. Pick the "ReSharper_ToggleSuspended"
  5. Press shortcut keys: and
  6. Press the "Assign" button.

Binding ReSharper_ToggleSuspended to a shortcut key (in my case: Ctrl-Shift-Q) works very well. With ReSharper not supporting the async CTP yet (as of mid-2011), when dipping into the code the uses the async keyword, this shortcut is invaluable.




回答4:


I always forget how to do this and this is the top result on Google. IMO, none of the answers here are satisfactory.

So this time, for the next time I search this and to help others, here's how to do it and what the button looks like to toggle it:

Open package manager console via the Quick Launch bar near the caption buttons to launch a PowerShell instance. Enter the code below into the Package Manager Console Powershell instance:

If you want to add it to the standard toolbar:

$cmdBar = $dte.CommandBars.Item("Standard") 
$cmd = $dte.Commands.Item("ReSharper_ToggleSuspended")
$ctrl = $cmd.AddControl($cmdBar, $cmdBar.Controls.Count+1)
$ctrl.Caption = "R#"

If you want to add it to a new custom toolbar:

$toolbarType = [EnvDTE.vsCommandBarType]::vsCommandBarTypeToolbar
$cmdBar = $dte.Commands.AddCommandBar("Resharper", $toolbarType)
$cmd = $dte.Commands.Item("ReSharper_ToggleSuspended")
$ctrl = $cmd.AddControl($cmdBar, $cmdBar.Controls.Count+1)
$ctrl.Caption = "R#"

If you mess up or weren't happy with the bar you added it to and need to start over, remove it with:

$ctrl.Delete($cmdBar)
$dte.Commands.RemoveCommandBar($cmdBar)

In addition to adding the button, the keyboard shortcut ctrl+shift+Num -, ctrl+shift+Num - (that is: ctrl shift and double-tap keypad_minus) works great.

EDIT: Looks like StingyJack found the original post I found long ago, that never shows up when I do a google search for this: https://stackoverflow.com/a/41792417/16391




回答5:


In Visual Studio 2017 ReSharper 2018.X.X can be enabled and disabled by going to Help > Manage Visual Studio Performance. Then select JetBrains ReSharper ... under Extensions.




回答6:


You can add a menu item to toggle ReSharper if you don't want to use the command window or a shortcut key. Sadly the ReSharper_ToggleSuspended command can't be directly added to a menu (there's an open issue on that), but it's easy enough to work around:

Create a macro like this:

Sub ToggleResharper()

    DTE.ExecuteCommand("ReSharper_ToggleSuspended")

End Sub

Then add a menu item to run that macro:

  1. Tools | Customize...
  2. Choose the Commands tab
  3. Choose the menu you want to put the item on
  4. Click Add Command...
  5. In the list on the left, choose "Macros"
  6. In the resulting list on the right, choose the macro
  7. Click OK
  8. Highlight your new command in the list and click Modify Selection... to set the menu item text etc.



回答7:


You need to goto Tools-->Options--->Select Resharper--->Click on suspend now,to disable it




回答8:


In ReSharper 8: Tools -> Options -> ReSharper -> Suspend Now




回答9:


Tools -> Options -> ReSharper (Tick "Show All setting" if ReSharper option not available ). Then you can do Suspend or Resume. Hope it helps (I tested only in VS2005)




回答10:


For ReSpharper 2017.2.2 goto ->ReSpharper->options-> Product and features.




回答11:


In case the solution did not help to just suspend resharper (STRG+R, STRG+R did still not work for example) I decided to disable the plugin and restart visual studio.

VisualStudio > Extras > Extensions > Resharper > Disable

https://docs.microsoft.com/en-us/visualstudio/extensibility/how-to-diagnose-extension-performance



来源:https://stackoverflow.com/questions/2189792/how-can-i-disable-resharper-in-visual-studio-and-enable-it-again

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