Questions tagged [resharper]

ReSharper is a refactoring and productivity extension by JetBrains that extends native functionality of Microsoft Visual Studio versions since 2003.

ReSharper is a productivity tool for Visual Studio that aims to improve the developer experience. Providing additional features for error correction, code completion, navigation, search, syntax highlighting, formatting and cleanup, code generation and optimization, it carries out a large number of automated refactorings and streamlines unit testing using NUnit, MSTest, xUnit.net, MSpec (via plugin), amongst other features (all without the need to compile).

Current ReSharper releases support Visual Studio 2010-2019; previous versions supported Visual Studio 2003-2008.

ReSharper currently supports C#, VB.NET, ASP.NET, ASP.NET MVC, Razor, TypeScript, JavaScript, CSS, HTML, XML, XAML, MSBuild and NAnt build scripts.

ReSharper's functionality can be significantly extended with its Open API. In fact, most of ReSharper's features are implemented using this same API that is available in ReSharper plugins.

4908 questions
94
votes
36 answers

What ReSharper 4+ live templates for C# do you use?

What ReSharper 4.0 templates for C# do you use? Let's share these in the following format: [Title] Optional description Shortcut: shortcut Available in: [AvailabilitySetting] // Resharper template code snippet // comes here Macros properties (if…
Rinat Abdullin
  • 23,036
  • 8
  • 57
  • 80
91
votes
18 answers

Ctrl+R, Ctrl+R command not working

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…
mwright
  • 4,099
  • 7
  • 30
  • 40
88
votes
24 answers

Why can't I reference my class library?

I have a solution that contains a website and a class library in Visual Studio 2008. I then have another web site project outside of the solution that needs to reference the class library. I right click the Bin folder or Project and select Add…
Brandon
  • 68,708
  • 30
  • 194
  • 223
87
votes
5 answers

Impure method is called for readonly field

I'm using Visual Studio 2010 + ReSharper and it shows a warning on the following code: if (rect.Contains(point)) { ... } rect is a readonly Rectangle field, and ReSharper shows me this warning: "Impure Method is called for readonly field of…
Acidic
  • 6,154
  • 12
  • 46
  • 80
86
votes
5 answers

Resharper's example code for explaining "Possible multiple enumeration of IEnumerable"

Sometimes Resharper warns about: Possible multiple enumeration of IEnumerable There's an SO question on how to handle this issue, and the ReSharper site also explains things here. It has some sample code that tells you to do this…
user2250250
  • 865
  • 1
  • 7
  • 7
85
votes
10 answers

Enter., Backspace and the navigation keys not responding in Visual Studio 2010 w/ Powertools/Resharper

I have this very annoying problem that in Razor Views the Enter, Backspace and the navigation keys frequently do not respond. I have to restart VS to get it back to normal again. Am I missing something?
Dabblernl
  • 15,831
  • 18
  • 96
  • 148
85
votes
3 answers

How to share the same Resharper settings between multiple solutions, with no manual intervention?

Our projects are organized in a master solution (containing every project) and multiple smaller solutions containing groupings of related projects. I would like to share the same Resharper settings across every solution, making sure that the…
julealgon
  • 7,072
  • 3
  • 32
  • 77
83
votes
9 answers

Keyboard shortcut to close all tabs but current one in Visual Studio?

Does anyone know a keyboard shortcut to close all tabs except for the current one in Visual Studio? And while we're at it, the shortcut for closing all tabs? Is there a Resharper option for this? I've looked in the past and have never been able to…
Ted
  • 7,122
  • 9
  • 50
  • 76
80
votes
7 answers

I need a workaround for Resharper when it says 'Failed to modify Documents'. Does anybody know why it does this and how to get around it?

I have noticed a few times over the past months that sometimes I will use the little yellow lightbulb icon and right click it and select an option for it to fix something for me and then it just highlights what it was going to fix and pops up a…
Curtis
  • 5,794
  • 8
  • 50
  • 77
79
votes
5 answers

Custom Brace formatting with Resharper

I'm using Resharper 4.5 and I need custom formatting of braces when writing an array or object initializer. Resharper supports some styles: Gnu Style: int[] array = new int[] { 1, 2, 3 …
Hadi Eskandari
  • 25,575
  • 8
  • 51
  • 65
77
votes
3 answers

Fastest way to update namespaces with ReSharper?

I have been doing some refactoring and reorganization and I have moved a bunch of files around. I want to update each file so it has the "correct" namespace according to its new location. With ReSharper, I can go into each file and it shows me that…
leora
  • 188,729
  • 360
  • 878
  • 1,366
74
votes
7 answers

Is Int32.ToString() culture-specific?

I'm running a beta version of ReSharper, and it's giving me warnings for the following code: int id; // ... DoSomethingWith(id.ToString()); The warning is on the id.ToString() call, and it's telling me "Specify a culture in string conversion…
Joe White
  • 94,807
  • 60
  • 220
  • 330
74
votes
4 answers

Using a class's static member on a derived type?

Using Resharper 4.1, I have come across this interesting warning: "Access to a static member of a type via a derived type". Here is a code sample of where this occurs: class A { public static void SomethingStatic() { //[do that thing you…
Swim
  • 1,561
  • 1
  • 12
  • 18
73
votes
9 answers

ReSharper key bindings problem

I use: Visual Studio 2010 Ultimate, Resharer 6. In ReSharper's options i choose Visual Studio keyboard sheme and click Apply Sheme: After that some shortcuts are not assigned, such as: Go to Declaration, Go to implementation, Find Usages, Complete…
DeeRain
  • 1,344
  • 1
  • 15
  • 24
72
votes
12 answers

How do you find all implementations of an interface?

Suppose you have an interface defined in C#. What is the easiest method to find all classes that provide an implementation of the interface? The brute force method would be to use "Find References" in Visual Studio and manually look through the…
iammichael
  • 9,477
  • 3
  • 32
  • 42