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
225
votes
5 answers

What does CultureInfo.InvariantCulture mean?

I have a string of text like so: var foo = "FooBar"; I want to declare a second string called bar and make this equal to first and fourth character of my first foo, so I do this like so: var bar = foo[0].ToString() + foo[3].ToString(); This works…
JMK
  • 27,273
  • 52
  • 163
  • 280
194
votes
57 answers

Test method is inconclusive: Test wasn't run. Error?

I have a test class and below I have posted a sample test from the test class namespace AdminPortal.Tests.Controller_Test.Customer { [TestClass] public class BusinessUnitControllerTests { private IBusinessUnitRepository…
Cybercop
  • 8,475
  • 21
  • 75
  • 135
192
votes
6 answers

What is the difference between a regular string and a verbatim string?

I have a trial version of ReSharper and it always suggests that I switch regular strings to verbatim strings. What is the difference?
Xaisoft
  • 45,655
  • 87
  • 279
  • 432
191
votes
15 answers

How to make ReSharper re-evaluate its assembly reference highlighting

I am creating a Prism Project Template, and the template works great. But after I create a project with the template some of the files look like this: Despite appearances, everything is just fine. If I do a Rebuild All I see that the solution…
187
votes
6 answers

Unable to type in Visual Studio

I am unable to edit any files in a project in Visual Studio 2013. It only happens in one project. If I open a different project I am able to type fine, but once I go back into the problem project I am unable to type in the editor windows. Not…
Corey Witherow
  • 2,472
  • 2
  • 26
  • 37
185
votes
8 answers

What are some alternatives to ReSharper?

I'm considering purchasing a ReSharper license, but are there any possible alternatives to ReSharper and how would you rate these compared to ReSharper? It doesn't necessarily have to be a free alternative, but I would just like to know how good…
Riain McAtamney
  • 6,342
  • 17
  • 49
  • 62
181
votes
12 answers

How do I generate a constructor from class fields using Visual Studio (and/or ReSharper)?

I've gotten accustomed to many of the Java IDEs (Eclipse, NetBeans, and IntelliJ IDEA) providing you with a command to generate a default constructor for a class based on the fields in the class. For example: public class Example { public…
Elijah
  • 13,368
  • 10
  • 57
  • 89
179
votes
4 answers

Why should I use var instead of a type?

Possible Duplicate: ReSharper and var After I have installed ReSharper it demands(by warnings) that I use var whenever possible, for example UnhandledExceptionEventArgs ue = (UnhandledExceptionEventArgs) t; ReSharper wants to turn it into var ue…
IAdapter
  • 62,595
  • 73
  • 179
  • 242
176
votes
7 answers

String Interpolation vs String.Format

Is there a noticeable performance difference between using string interpolation: myString += $"{x:x2}"; vs String.Format()? myString += String.Format("{0:x2}", x); I am only asking because ReSharper is prompting the fix, and I have been fooled…
Krythic
  • 4,184
  • 5
  • 26
  • 67
167
votes
2 answers

Why is '397' used for ReSharper GetHashCode override?

Like many of you, I use ReSharper to speed up the development process. When you use it to override the equality members of a class, the code-gen it produces for GetHashCode() looks like: public override int GetHashCode() { unchecked …
programmer
  • 4,342
  • 4
  • 24
  • 21
147
votes
0 answers

Does inverting the "if" improve performance?

I've been using ReSharper for a while now and sometimes it suggests that I invert the if. I guess an example would be a better explanation of my situation: public void myfunction(int exampleParam){ if(exampleParam > 0){ //Do something…
Nasreddine
  • 36,610
  • 17
  • 75
  • 94
144
votes
9 answers

ReSharper Abbreviations List: Where can I modify it?

I am using ReSharper 4.5, and what often happens when I am converting explicit properties into auto-properties, is that I will accidentally chose "Add XX to abbreviations list". Ie: I want to convert CustomerID into an autoproperty, but due to quick…
Alex Czarto
  • 3,151
  • 4
  • 28
  • 28
140
votes
2 answers

Disable C# 6.0 Support in ReSharper

While using ReSharper, it suggested "Enable C# 6.0 support for this project". I foolishly clicked on it, and now as advertised it's giving me suggestions for C# 6.0 - which then give me errors as I am not using C# 6.0 in this project. How can I…
Mathieu Lomax
  • 1,521
  • 2
  • 9
  • 7
137
votes
2 answers

C# 8 understanding await using syntax

I have next method: public async Task> GetQuotesAsync() { using var connection = new SqlConnection(_connectionString); var allQuotes = await connection.QueryAsync(@"SELECT [Symbol], [Bid], [Ask], [Digits] FROM…
Uriil
  • 11,948
  • 11
  • 47
  • 68
131
votes
10 answers

Disable, but not uninstall Resharper 4.x onwards

Any ideas on how to disable, but not uninstall Resharper 4.x or above?
Graviton
  • 81,782
  • 146
  • 424
  • 602