FAQ Database Discussion Community


find which types from given dll are used in my solution

c#,.net,resharper
I've got sulution which uses external dll. What is the best way to list all types from that external dll used in my solution? Maybe resharper has got any option which may suport this?...

Resharper: code issues only in cs files

c#,.net,visual-studio,model-view-controller,resharper
When I use "Code issue in solution" all get all code issues in all solution. In cs, cshtml, js etc file. How can check code issues only in *.cs files

Why does ReShaper suggest me to make type parameter T contravariant?

c#,resharper
ReShaper suggests me to make type parameter T contravariant: interface IBusinessValidator<T> where T: IEntity { void Validate(T entity); } Into this interface IBusinessValidator<in T> where T: IEntity { void Validate(T entity); } So what is different between <T> and <in T>? And what is the purpose of contravariant here? Update:...

Mising code snipper testc after R# install

.net,visual-studio,testing,resharper,code-snippets
After Install R#8 on my Visual Sudio 2013 Ultimate, I lost "testc" snippet. Rest of code snippets work fine, but This one in unrecognized. How can I turn it on again?

Variables in preprocessor IFs not found ReSharper

c#,resharper
class a { private int num; private Person p; .... public int SomeMethod() { #IF someCondition p = new Person(); num = 2; p.Legs = num; } } Resharper says here that both of the fields are not being used. Which is false, i.e. depends on the condition. How can...

Format Line not actually formatting.

c#,resharper,stylecop
I have Resharper 9 installed and StyleCop as I'm trialling then to see if my work should get the tools installed for all developers (So I'm very new to using both tools). StyleCop has a number of rules that affect line formatting, such as: SA1116. Resharper then picks up when...

ReSharper remove unused directives In file adds summary and header to methods and parameters

c#,resharper
When I use "Remove Unused Directives in file" reSharper command on current .cs file, the reSharper is puts summary and header on the all methods and parameters and namespaces. How can I rid this ? ReSharper version : 9.0 Update 1 , Visual Studio 2013...

Resharper extend selection and shrink selection

visual-studio-2013,resharper
I can't believe I'm asking this. I have resharper 9.0 and visual studio 2013 community. My extend selection hotkey is supposed to be ctrl alt right but that doesn't work at all. I can use ctrl-w instead but ctrl-shift-w does not work for shrinking. I'd like to remap the bindings...

Resharper - not able to configure individual keyboard shortcuts

visual-studio,resharper
I am a long time CodeRush user trying out Resharper 9 with VS 2013. I am not able to find the option for configuring individual keyboard shortcuts. I don't see list of commands under Environment > Keyboard & Menus as mentioned in the documentation. 'Apply Scheme' keeps the screen unchanged....

What is the best way to restrict method access at compile time?

c#,.net,resharper,roslyn
Let's say I have a Manager class public class Manager { public Item Create() { ... return new Item(...); } } and I have an Item class: public class Item { [AllowCallBy(typeof(Manager))] public Item(...) { } ... } Now, I would like to use the easiest and most straightforward way...

Localizable string warning R#

c#,winforms,resharper,localizable.strings
I'm a beginner in c# syntax, been programming in vb.net for quite a few years. ToolStripMenuItem setPriorityDropdown = new ToolStripMenuItem {Text = "Set priority"}; In this code, R# warns that "Set priority" is a localizable string. I've searched online and found that to remove the warning you should use @...

ReSharper Documentation Tags Formatting One Per Line

c#,visual-studio-2012,resharper
I'm trying to get ReSharper to behave properly when creating XML comments. When I see the preview it looks exactly how I want it to look but when I actually document a method or a class it isn't formatting as per the preview. I get this: /// <summary> /// The...

Resharper sort properties, fields by name on file saving

c#,.net,visual-studio,resharper,codemaid
I use Resharper 8.2 with Visual Studio 2013 Ultimate. Is it possible to setup this environment to sort method, fields, property by alphabet, but only when I save file? I know that CodeMaid has this feature.

Search for methods/properties of an inherited class used by inheritor

c#,.net,visual-studio-2013,resharper
I'm tasked with rewriting some old code that we have, and I'm currently in the process of analyzing it. At first glance I believe that one of the classes is needlessly inheriting another class, because it seems to overwrite nearly every method and it doesn't seem to use any of...

“Variable 'X' can be made constant”, what does 'constant' mean?

typescript,resharper,ecmascript-6
VStudio or ReSharper is giving me the suggestion below: What does constant mean in this scenario? If it's a constant in the current method scope, what's the purpose? Methods tend to be small and therefore it shouldn't give any advantage compared to be a regular var? Please enligten me...

Visual Studio Unit Test Code Base is different from machine to machine

c#,.net,unit-testing,visual-studio-2012,resharper
I have interesting behavior on my machine during unit testing using VS Unit testing framework. Machine is win-7, VS2012 Update 1, Resharper 7.1.1 When I run Unit Tests it creates 2 folders under TestResults: Deploy_UserName YYYY-MM-DD hh_mm_ss UserName_MachineName YYYY-MM-DD hh_mm_ss Under UserName_MachineName..., there is folder Out and this is where...

prevent unassigned objects, any reason this is a bad design consideration?

c#,wpf,resharper,code-design
In my WPF application, I have a few places that based on a given ID of a record, I call a new form to be displayed as modal to view details. It then closes and returns back to calling source as expected. All this works no problem. To keep this...

Resharper - Disable once with comment - all instances in line

resharper
I have a method definition, and there is the same Resharper warning on several of the parameters of the method. If I right click on the first parameter and choose "Disable once per comment", it adds the comment, but the highlighting only disappears from the first parameter with the issue....

resharper test runner - how to execute by category?

c#,unit-testing,visual-studio-2012,resharper
Resharper version 7.1 Visual Studio 2012 Ultimate Two part question: Q1: When I select "run unit tests" in the solution explorer resharper automatically opens a test fixture runner and executes ALL test fixtures. However, I have categorized tests in to two categories: 1) "long running" and 2) "short running". Is...

Resharper “join declaration and assignment” don't convert to “var”

c#,refactoring,resharper
When using Resharper and editing C# code, when I choose to apply a "join declaration and assignment" suggestion, it changes my explicit type declaration to "var". Example: If I have: int myNumber; myNumber = 0; It will refactor it to: var myNumber = 0; I do not like this. I...

Can Resharper 9 perform pattern search and replace on HTML markup?

html,visual-studio,twitter-bootstrap,resharper
I am in the process of restructuring large amounts of MVC code to use Bootstrap. The process is very tedious and error prone because it's easy to clobber the markup. The majority of the code, however, is structurally identical and it could be at least partially automated. If I could...

ReSharper 9 Adding menu item action not working

c#,nuget,resharper,nuget-package,resharper-9.0
Trying to update my resharper extension to work for 9.0, before I was just moving the dll into the plugins directory but now I need to figure out how to get nuget to work... I've been able to package the files, dll gets included in the nupkg but I think...

Get the results of Code inspections

.net,cmd,resharper,static-code-analysis
I installed Resharpers command line tool.Then I tried InspectCode SolutionFile.sln > errors.txt. The output in errors.txt is JetBrains Inspect Code 9.1 Running in 64-bit mode, .NET runtime 4.0.30319.34014 under Microsoft Windows NT 6.2.9200.0 Solution-wide analysis is DISABLED Running inspections Inspecting <Project>\Common\Bindable.cs Inspecting <Project>\Common\Converter.cs and so on.. How can I convert...

ReSharper's is not working with local paths

javascript,unit-testing,jasmine,resharper,qunit
I'm trying to reference some libs in qunit tests. When I'm using Resharper's /// <reference path="/Scripts/require.js" /> It produces the following reference in the html: <script type="text/javascript" src="reference/~/../MyProjectFolder/Scripts/require.js"></script> So reference is broken. I've tried different ways to specify path like absolute path, relative path, tried to start path with '~'...

resharper is not ignoring tests marked with Category Attribute in XUnit

resharper,xunit.net
having: [Category("Contract")] public class ProgramClientShould { } or: [Trait("Contract", null)] public class ProgramClientShould { } and Resharper -> Options -> Tools -> Unit Testing: "Skip tests from categories" with value "Contract" Still, tests in ProgramClientShould are executed. What's wrong?...

How to fix a lot of unit tests when results are changed

c#,unit-testing,nunit,resharper
I use Visual Studio with Resharper and NUnit test framework. Sometimes a small change in business logic code breaks a lot of unittests. It's OK, you know that the results of unittests would be different and new values are valid now. Is there a way to quick-fix all of them?...

How can I split same-project unit tests into separate assemblies?

c#,visual-studio,resharper,teamcity
I have a few test projects, one of which has many unit tests, all very related to doing certain calculations. Running all unit tests takes a long time. So, I'm looking for a way to easily split tests into nightly unit tests and all other unit tests. How can I...

Disable “click to navigate” icons in Resharper

resharper
How can I disable the "click to navigate" icons on the left bar? I believe they are called "gutter" icons but I just didn't find a way to disable them....

ReSharper and NUnit's multiple domains

nunit,resharper
I recently had to enable this option in ReSharper: Use separate AppDomain for each assembly with tests Looking at the NUnit documentation, I suspect the option above executes NUnit with the parameter "domain/multiple", for which "a separate test domain is created for each assembly". Could you please confirm me that...

Nuget-deployed C# files excluded from Resharper analysis

c#,nuget,resharper
I'm having trouble understanding a behaviour of Nuget. I've created a basic package that deploys a single Test.cs file into an "HtmlHelpers" folder in a project. I'm following the "convention based working directory" method described on the Nuget site. The issue I'm having is Resharper file analysis isn't enabled for...

Resharper code annotations don't work when referencing the compiled dll

c#,resharper
Let's say I have the following class public class MyClass { [NotifyPropertyChangedInvocator("propertyName")] public void RespondToProperty(string propertyName) { //Some code here... } } When another project in the solution uses this class the annotations work. Resharper does auto-complete the caller class properties (as it should). But when I reference the compiled...

IntelliSense: aria-valuemax and data-ng-style aaaargh?

visual-studio-2013,resharper,intellisense
While typing code in a Razor (.cshtml) file using Visual Studio 2013 (Update 4) with ReSharper 8.2.3 (updated by suggestion from this question), my IntelliSense is doing stuff that is driving me crazy. I am a heavy user of the IntelliSense+Tab key when typing to speed up my coding, but...

How ReSharper chooses whether to show library types in hierarchies inspector?

c#,types,resharper,hierarchy,inspect
Sometimes ReSharper is kind and shows all types. Sometimes only my own types. Can't follow the logic behind this... How to force it to show all types? Tried with Navigate -> Derived Types and Inspect -> Type Hierarchies. Visual Studio 2013 ReSharper 9...

Keyword var performance for compilation

c#,visual-studio,compilation,resharper,var
Refactoring a big project (in term of code lines) I got to know ReSharper and the topic using var instead of the type which will only affect in compilation time. Does it makes a big impact in the compilation time? I would like to define a code style for it...

MSpec Json.NET deserialization test fails in ReSharper but passes in NCrunch

c#,json.net,resharper,mspec,ncrunch
I have the following two unit tests: one using MSTest and one using Machine Specifications. As far as I can see they should behave identically. However, while the first one passes in both the NCrunch and ReSharper test runners, the second one fails in ReSharper. using Machine.Specifications; using Microsoft.VisualStudio.TestTools.UnitTesting; using...

Exporting Resharper Inspection Results for Incoming Calls?

visual-studio,resharper
In Resharper, Inspection Results - Incoming Calls Is it possible to export the results to Text,Html or XML? There is an export button with drop down for Text,Html and XML. But clicking it does not bring up the Reharper save to file to dialog. Highlighting and pressing ctrl + C...

How to change resharper 'usages window' selection hightlight color?

visual-studio-2010,resharper
I am using Resharper with visual studio 2010 for C# development. By 'Usages Window' I mean the tabbed window where usages are shown when there is more than one usage of the symbol searched for. The problem I have is that the selected line background is dark gray while the...

ReSharper 9: Microsoft Reference Source, Instead of Decompiled .cs Files

c#,visual-studio-2013,resharper,decompiler,reference-source
I'm using ReSharper 9.1.1 on Visual Studio 2013. On some classes, for example System.Data.SqlClient.SqlParameter when I right click on the word SqlParameter and click Go to Definition it directs me to some decompiled cs file C:\Users\X\AppData\Local\JetBrains\Shared\v02\DecompilerCache\decompiler\D514DFA3-5BC8-4AE6-ABD0-D615A7C2893F\3c\1ec3bc9a\SqlParameter.cs On the top of the file it says: // Decompiled with JetBrains decompiler //...

Messed up color scheme in ReSharper C++

c++,visual-studio-2013,colors,resharper,resharper-c++
After upgrading to the latest ReSharper Ultimate version, my VS color scheme is kinda messed up. i have tried re-installing it, deleting the VC12_Config key from the registry and modify the "extensions changed file". If I suspend ReSharper my color scheme switches back to the default dark skin (which I...

Using custom extension (/x) in resharper 9.0 command line inspection

resharper,command-line-tool,code-inspection,resharper-9.0
So I've got a custom nuget package I build which is installed in vs2013 through the ReSharper extension manager interface. I remember back with resharper 8.2 I could specify a plugin parameter /plugin=xxx.dll to import a custom plugin but with the updated command line tools for resharper 9.0 it seems...

Different Behavior when running nunit tests from project and from solution

entity-framework,nunit,resharper
I have various projects in a Solution with many tests, one of them use entities and has the following behaviour: If I right click run all tests on my project everything runs smoothly but if I right click on my solution and does the same I get: System.InvalidOperationException : No...

Resharper: File header text not automatically used for new files

c#,visual-studio-2010,resharper,stylecop
I am using VS2010, Resharper 8.0.1, StyleCop 4.7.45. I have defined a File header text in the resharper options and (wrongly) assumed it would then be used when refactoring (using "move class to a new file to match file name" function). This also doesnt use the Visual Studio file templates...

Does Resharper have a “search everywhere”?

visual-studio,visual-studio-2012,intellij-idea,resharper
I normally use WebStorm (spin-off of IntelliJ IDEA), which has a wonderful "search everywhere" feature. I use this for finding files, types, and especially commands. I'm just starting to use Resharper in Visual Studio 2012, and it's sometimes hard to find the commands I'm looking for. I was hoping to...

Resharper is suddenly showing red for Razor syntax

c#,razor,resharper
I don't know, all of sudden Razor syntax showing in Red. I suspended and resumed and also closed VS and restarted still the same. Anything else to do? ...

Resharper Formatting Ternary Operator

resharper
This is driving me up the wall now. The ternary formatting options in Resharper -> Options -> C# do not cover indentation, just spacing of '?' and ':' characters, and line chopping. What I want is: var x = expr1 ? expr2 : expr3; But what I get is: var...

Why does ReSharper tell me this expression is always true?

c#,resharper,boolean-logic,roslyn
I have the following code which will tell me whether or not a certain property is used elsewhere in the code. The idea behind this is to verify whether a property with a private setter can be made readonly. There are multiple gotchas here but the major ones are that...

How can I record a “(” in a macro in vsVim?

visual-studio,resharper,vsvim
I'm trying to record a macro that will type a small chunk of text that contains a parenthesis "(", whenever I try to play the macro it doesn't type the "();" at the end of the line. My guess is that parenthesis in a macro may have some special meaning...

What does this red square icon mean in Visual Studio 2013 Solution Explorer?

visual-studio-2013,resharper,ankhsvn
In the image below, there are red square icons next to items in the Solution Explorer. I can't figure out what they indicate. I'm using Resharper and AnkhSVN, so they may be from either of those two packages, or from Visual Studio itself. Does anyone have any idea what they...

Use ReSharper to Change an indexer to Getter/Setter methods

c#,resharper
Using ReSharper, is there a way to change this code: TValue this[TIndex index] { get // optional { // getter code } set // optional { // setter code } } To this code: TValue GetStuff(TIndex index) { // getter code } void SetStuff(TIndex index, TValue value) { // setter...

Angularjs - Resharper intellisense broken with TypeScript?

angularjs,typescript,resharper,intellisense,definitelytyped
I have VS 2013 Update 4, TS 1.4, latest WebEssentials and R# 8. I am trying to create some AngularJS code in my MVC solution. In installed Angularjs and angular.d.ts via nuget. I have done the same for "marked" and also jQuery installed automatically as Angular dependency. How, none of...

ReSharper 9.0 styling: BSD indention is slightly off

c#,visual-studio-2013,resharper,resharper-9.0
Problem: Can't get the wanted styling from ReSharper. See below current and expected styles. ReSharper info: I'm using ReSharper 9.0.0.0 in C# environment, with these two relevant settings: Options > Code Editing > C# > Formatting Style > Braces Layout > Array and object initizlizer: At next line (BSD style)...

Resharper intellisense : how to show method return type

methods,resharper,intellisense
I've formatted my pc, and now i can't seem to find the option to show the method return type in the intellisense... Using VS 2015 RC with Resharper 9.1.1 Thanks, screenshot below. ...

Why does the ReSharper Find Usages command search resx files?

resharper
When I right-click a symbol and run the Find Usages ReSharper command, ReSharper will often seem to spend most of its time searching resx files. The majority of the time during which the progress dialog is visible, the file names shown in that dialog are various .resx files in the...

I cannot debug two projects at once - one with Resharper NUnit tests

debugging,visual-studio-2013,nunit,resharper
My team has a solution with multiple projects. One of these projects is an ASP.NET MVC website. Another project contains NUnit tests. We launch these NUnit tests inside Visual Studio 2013 with Resharper 8.2.2. Another developer on my team is able debug both the MVC project and the NUnit tests...

Add all Visual Studio unit tests with a specific TestCategory to a new Resharper testsession

visual-studio-2013,resharper,resharper-9.0
In Visual Studio, in the Test Explorer window, when I group the tests on 'traits', the tests are grouped on a specific category (the public sealed class TestCategoryAttribute class I've put on the unit test) Is there a way to do the same thing in the Resharper 'unit test sessions'...

How I can disable not relevant xaml warning

.net,wpf,xaml,resharper
On following XAML code I get warning that some file is missing. <Application.Resources> <!--Global View Model Locator--> <viewModel:ViewModelLocator x:Key="Locator" d:IsDataSource="True" /> </Application.Resources> The warning comes based on this code: if (!File.Exists(filename)) { throw new FileNotFoundException(string.Format("The specified file {0} is missing.", filename)); } Indeed this file is missing but in run...

How can I integrate ReSharper's Dotsettings File in SonarQube?

c#,resharper,sonarqube,bamboo,stylecop
I have a C# Project with a ReSharper Dotsettings file. I want to configure Sonar so that it uses my Dotsettings file. In my Dottsettings file i disabled many Rules. How can I integrate this file in SonarQube? This is my sonar-project.properties file (just the ReShaper part): #ReSharper sonar.resharper.mode= sonar.resharper.dotSettings.path=MyProject/ReSharper7-Coding-Style.dotsettings...

How to run nunit tests with asp.net 5 projects, espically with ReSharper?

nunit,resharper,asp.net-5
I am developing an asp.net 5 application targeting dnx451. The asp.net 5 project relies some libraries with unit-tests written for nunit 2.x. So the reasonable choice for me is to use nunit for testing the asp.net 5 project. When I running the unit test in ReSharper , the ReSharper says...

Increase recent clipboard pastes in Resharper?

resharper,resharper-8.2
i'm using Resharper 8.2. Looking at ctrl+shift+v : There are only 19 entries for history pastes. Question: Is there any file edit / setting edit that will allow me to increase the number of history entries ? ...

How to avoid 'Method is never used' message?

c#,visual-studio-2013,resharper,static-analysis,resharper-9.1
In the following example, Resharper complains about DoA() method never being used, despite being implemented by the 'AImplementator' class: namespace Test { public interface A { // Method 'DoA' is never used void DoA(); } public class AImplementator: A { public void DoA() { throw new System.NotImplementedException(); } } }...

SearchDomainFactory.Instance is obsolete: 'Inject me!' ( Can't find out how to create instance)

resharper,resharper-plugins,resharper-sdk
I'm in the process of trying to migrate a R# extension project from R# 6 to R# 8. (I've taken over a project that someone wrote, and I'm new to writing extensions.) In the existing v6 project there is a class that derives from RenameWorkflow, and the constructor used to...

Consolidate Redundant Condition

vb.net,visual-studio-2013,resharper
In a project that I am maintaining, Visual Studio is flagging some code for a high complexity. The code is creating raw RTF for a print preview, and has numerous lines with the same condition, If bolprint Then .... Some of the conditionals are one line, others are multi-line. Not...

How do I tell Resharper to look in a custom location for Partial views?

asp.net-mvc,razor,resharper
I have set up a project that has a custom ViewEngine that changes the traditional locations that Partials can be located. Previously, Resharper would let me F12 into my partial views, but that no longer works because Resharper thinks they don't exist even though they do. Can I do something...

Visual Studio - Add resharper shortcut to command

visual-studio-2013,command,resharper
I am currently using resharper and alt+shift+L command is used a lot by me. I would like to know if it's possible to add a command on some toolbar so that I can just click that directly instead of switching my hand between mouse and keyboard and then pressing alt+shift+L

Visual Studio - How to refactore javascript strings from double quotes to single quotes

javascript,c#,visual-studio-2013,refactoring,resharper
Is there an easy way to refactore all javascript strings from my solution to use single quotes ' instead of double quotes " If i have: var element = $(".classSelector"); ...({ url: "<%= Url.Action("action", "controller")%>", ... I would like to refactor my javascript in .js, .aspx, .ascx files to var...

Resharper Search with pattern method call

c#,replace,resharper
I want to replace this part of code using "Search with pattern...": public bool IsDbObjectsOK() { var result = 0; result = usp_IsDbObjectsOK(); if (result == 0) return true; return false; } public bool UnlockWindow() { var result = 0; result = usp_UnlockWindow(); if (result == 0) return true; return...

Is it safe to use field inside and outside synchronized block?

c#,.net,multithreading,resharper
Background Our app sends emails which are queued in a database table. We've had some instances of duplicate emails being sent, so I'm implementing a lock to prevent multiple threads from sending emails simultaneously. ReSharper is warning me that: the field is sometimes used inside synchronized block and sometimes used...