Questions tagged [resharper]
ReSharper is a refactoring and productivity extension by JetBrains that extends native functionality of Microsoft Visual Studio versions since 2003.
4,909
questions
0
votes
0
answers
49
views
Can Visual Studio 2022 (or ReSharper) show a list or tree of all references to a member sorted by order of execution?
I'm rewriting code in a class that changes private state across many different private methods and it's difficult to follow what value each member of the class will end up having.
Assignments are ...
1
vote
0
answers
24
views
Where's the code spending 95% of its time?
I ran dotTrace to profile my Blazor Server app. Below is the hotspot output.Under All Calls 100% it is only showing about 5% of the time. Where's the rest of the time being spent?
0
votes
1
answer
31
views
How do I profile a Blazor Server app using dotTrace from Visual Studio
I am trying to profile my Blazor server app using dotTrace and I can't find any way to have it launch the app plus display it in the browser. It launches the DOS box for the app. But no browser. And ...
0
votes
1
answer
16
views
How do you keep the autocomplete text box in JetBrains Rider or other Intellij IDEs from obscuring surrounding text?
As I'm typing in JetBrains Rider, the autocomplete textbox(s) will immediately appear over and under what I'm typing, which obscures the surrounding detail of the code that I'm writing. Often times I ...
0
votes
2
answers
63
views
Visual Studio Community 2022 adding newline after semicolon c#
When creating new properties in c#, everytime I press ; VS generates a new line, and I can't find the setting...
Anyone knows where to turn it off? Getting very annoying to remove all the new lines ...
0
votes
1
answer
39
views
Visual Studio 22 - Resharper - Cannot move line down
I am using Visual Studio 22 with ReSharper. I am trying to move a line of code down, and out of a block. ReSharper refuses to move the line down.
#include <iostream>
int main()
{
if (true)
...
1
vote
1
answer
36
views
Use pattern matching with a C# 7 tuple [duplicate]
I have the following code:
object foo = ("hello", "world");
var bar = foo as (string, string)?;
if (bar != null) { Console.WriteLine(bar.Value.Item1); }
Edit: I should say that ...
0
votes
1
answer
63
views
Nullable reference types: no warning in Visual Studio?
I am using .NET Core with its "new" features like nullable reference types. Why don't I get a Visual Studio warning (VS 2022, Version 17.6.5) for comparing a non-null string with null here:
...
0
votes
0
answers
25
views
How can I avoid a reported conflict when moving an explicit interface implementation into a derived class in ReSharper?
Given the following code
namespace MyNamespace
{
class MyExampleDerived : MyExampleBase
{
public int MyAnswer()
{
return 42;
}
}
class ...
0
votes
0
answers
11
views
View previous runs' stack traces (or possibly export them) from Resharper?
I recently discovered Resharper's Stack Trace explorer, which I was immediately grateful for. It makes reading and navigating them so much easier for me than in the years before I knew about it.
...
0
votes
1
answer
94
views
How do I prevent ReSharper/Rider from auto-formatting certain auto-generated files on save, in a way that will be shared with my team?
We use ReSharper/Rider on our .NET 4.7 project, and we have it configured to auto-format the files we edit whenever we save. This behavior applies to *.cs files, as expected, but it unfortunately ...
0
votes
1
answer
13
views
Resharper test output is empty in visual studio 'show output from'
In Visual Studio 2022, adding some unit test, I could configure the output of each unit test, it's working well as you can see in both images [Red one].
Also, I configured the IMessageSink in a ...
0
votes
0
answers
31
views
Struct Layout with array disables tests
Creating a packed struct in C# that contains an array causes all tests in my test project to produce an inconclusive result. In the case of Resharper's test runner, it produces the exit code 14942211. ...
1
vote
0
answers
15
views
Resharper - Run Unit Tests Until Fail - How many times has it run?
I had a flaky test. I think, I fixed it.
Now the tests are running until they fail (using resharper).
Say I'd like it to success 100 times before I call the flakiness gone.
I know that I can just ...
0
votes
1
answer
36
views
ReSharper and CMake conflict
We have a Visual Studio solution that uses CMake for project management. This means the solution folder is under CMake's control, and when CMake detects changes it regenerates the folder.
ReSharper ...
1
vote
0
answers
23
views
Is there any way that in project level I can define rule set that give me compile time error while using some properties?
Is there any way that in project level I can define rule set that give me compile time error while using some properties? Like In my project i want to enforced that No one should use DateTime.Now . ...
4
votes
1
answer
39
views
How do you mark implicitly loaded assemblies for an entire team?
The repository we work in contains multiple applications and services, and a whole bunch of DLL files that are shared among many of them. We have a form of inversion of control in place to keep the ...
2
votes
1
answer
50
views
What are 'quasi implementations'?
Sometimes when searching for references of a member, I get this popup, which often takes annoyingly long, so I tend to cancel. But I wonder: what am I missing? What are 'quasi implementations'?
0
votes
0
answers
8
views
Resharper missing some unit tests
I have added a few more unit tests to my solution and these unit tests are not available to be executed in Resharper. They are also not listed in the Resharper Unit Test Explorer.
I can execute them ...
2
votes
1
answer
107
views
Resharper inspection issue "Redundant dictionary 'ContainsKey' before adding to the collection"
Resharper is throwing this inspection issue:
Redundant dictionary 'ContainsKey' before adding to the collection
At this part of the code:
var userPref = new Preferences { Key = key, Value = value };
...
0
votes
0
answers
13
views
ReSharper Live template that uses return type and parameter type
I have a lot of methods coming from implementing interfaces that are pretty much boiler plate code:
public ResponseType DoSomething(RequestType request)
{
return HandleMessage<RequestType, ...
0
votes
0
answers
20
views
How to force ReSharper to keep/add a using static directive?
How can I force ReSharper in Visual Studio to add a static alias directive automatically, or, at least, prevent it from removing it upon cleaning usings when it is unused?
For example:
using static ...
0
votes
1
answer
43
views
Visual Studio 2022 Resharper can not resolve symbol
I use Visual Studio Enterprise 2022 LTSC 17.2 with ReSharper 2023.1. I work with several projects in one solution and many of them are referenced (we use custom build tool). Visual studio detects them ...
0
votes
1
answer
29
views
What might be causing ReSharper to detect unused types incorrectly?
Am having some problems with ReSharper (latest, 2023.1, installed for VS2017) and detection of unused types.
When opening class files, some class names are ghosted as though they're not referenced, ...
0
votes
1
answer
59
views
Rider/ReSharper - Wrap chained method calls before first method
I have set Line Brakes and Wrapping -> Arrangement of Members Access Expression -> Wrap chained method calls to Chop always
Rider is formatting chained method calls this was:
var numbers = ...
1
vote
1
answer
31
views
Can I get ReSharper to generate "overrides" for non-virtual functions?
I know it's not overriding, but I don't know if there's a name for "shadowing" parent functions in child classes. (If there is please tell me)
Example:
class Foo
{
public:
void fn(std::...
0
votes
0
answers
11
views
Does ReSharper have a refactor to eliminate the closing html tag
Does ReSharper (or Visual Studio) have a refactoring where it can turn
<DxCheckBox @bind-Checked="@(((UserListModel)context.EditModel).EmailConfirmed)"
AllowIndeterminateState="...
1
vote
1
answer
13
views
How do you exclude the RazorPage.ExecuteAsync method from test coverage in Resharper?
Current project has a collection of Razor pages with associated PageModels. The page models are implement business logic to some degree thus require unit testing. The page models themselves are basic ...
0
votes
0
answers
20
views
Resharper cli does not format indents
I want to clean up my code by using jb cleanupcode --settings="MY.sln.DotSettings" SLN_NAME
In my dotsettings I have rules like (test values)
<s:Int64 x:Key="/Default/CodeStyle/...
0
votes
0
answers
13
views
Does Resharper detect changes in settings from settings file imported via 'This Computer'?
I have imported resharper settings in Visual Studio 2022 via 'Resharper - Settings Layers' -> 'This computer' -> 'Open settings file'. The settings file is located on a network shared file ...
1
vote
1
answer
39
views
Add typos in resharper
While using Resharper, and it's ReSpeller, I am trying to remove certain words from the dictionary.
For example (though not the most relevant), I want to see a typo warning (or something of that sort) ...
0
votes
1
answer
102
views
Visual Studio 2022 ReSharper Jquery intellisense not showing
I installed Visual Studio 2022 with the ReSharper extension, but the jquery intellisense is not showing. I already check the checkbox of Havascript and TypeScript, Protobuf and CSS Language in ...
0
votes
1
answer
30
views
Prevent Resharper Code Cleanup from breaking null conditional operator to new line
When applying the Resharper code cleanup, the null conditional operator is wrapped to a new line:
After formatting
var result = Get(s => s.Information == information)
?....
0
votes
1
answer
15
views
Putting statement on one line when using remove braces refactoring in ReSharper
ReSharper has a feature that allows you to remove braces on single-line statements.
Unfortunately it puts the statement on its own line, but I want everything to be on the same line. Is there any way ...
0
votes
1
answer
34
views
Resharper: Can I control where Completion/Intellisense pops up?
When I am typing in Visual Studio with Resharper enabled, I start typing a function call and it brings up the following popups (see the image below).
Now that's a lot of useful information but not ...
0
votes
0
answers
18
views
Resharper formatting issue: if() statement in VS2022 C++ code [duplicate]
I'm working on vs2022 with resharper. And there is a problem with me editing the if() in a {}.
float example (){
if()
}
the moment i tapped the () after if, resharper format the code like this:
float ...
0
votes
1
answer
33
views
How do I break on assert failures when debugging?
I am using NUnit 3.13.3 and Resharper 2023.1.1. I am using Visual Studio 2019 and Visual Studio 2022.
In Visual Studio 2019, if I write a test procedure and use the Resharper test runner to debug it, ...
0
votes
1
answer
101
views
Process.StartInfo of Process.GetCurrentProcess() throws InvalidOperationException in .NET 6 unit test
I have a .NET C# project that compiles against different target frameworks.
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<...
1
vote
1
answer
109
views
In Visual Studio 2022 (with Resharper), what setting controls the color of the "inline" error hints?
I'm running Visual Studio 2022 with Resharper in the Dark theme. I see the following inline UI element for build errors, which is very hard to read with the black text on a very dark background. I'm ...
0
votes
0
answers
69
views
ReSharper CLI Global Tools generate .editorconfig and .DotSettings
I am currently using the latest version of the https://www.nuget.org/packages/JetBrains.ReSharper.GlobalTools
dotnet tool install --global JetBrains.ReSharper.GlobalTools --version 2023.1.0
I wonder ...
0
votes
1
answer
66
views
*.Designer.vb file automatically altered to contain lines with error "Only member access expression can start an invocation statement."
I have a vb.net application in which I changed the Dock property of a RibbonControlAdv from TopMost (did not know that was a valid value) to Top.
When I save the project, it is obviously doing a lot ...
0
votes
1
answer
54
views
Move to 'class.cs'
If I start with a new class in a same file as another and then start the action Move to 'filename.cs' it always inserts this header:
// Licensed to the .NET Foundation under one or more agreements.
// ...
0
votes
0
answers
12
views
Resharper NUnit test actions hiding refactoring actions
I'm using Resharper in Visual Studio 2019
In test classes, the usual refactoring actions in the margin are replaced by buttons to run the tests, e.g.:
test class in Visual Studio showing test buttons
...
0
votes
0
answers
25
views
Get a warning in Visual Studio that it can't find css files in defined locations
This is a ReSharper issue (if I disable ReSharper, the problem goes away). I get a warning in the IDE that it cannot find the following css files:
Ones in _content
Ones in _framework
The built at ...
0
votes
1
answer
32
views
Is there a way to tell ReSharper to retain some old styles?
While I like a lot of the improvements Microsoft has made in ASP.NET, I don't like eliminating main(string[]args) and eliminating {...} for namespaces.
Is there a way to tell ReSharper I want it to ...
-1
votes
1
answer
379
views
Transitive dependency `microsoft.netcore.platforms 5.0.0` for EF Core SqlServer package
Checking my CSPROJ file, I noticed a warning (blue squirly) on this package.
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.4" />
The error ...
0
votes
0
answers
13
views
How can I use Intellisense when editing with multi caret(cursor)?
I want to use Intellisense when editing with multi caret(cursor) like visual studio code.
Is there any options for it in Visual studio or Resharper?
0
votes
0
answers
35
views
On File Move the curly brace layout changes - why?
I have Visual Studio 2022 and Resharper (latest versions). My Code style for curly braces is:
if(true) {
//....
}
!!! While typing end editing code everything works great !!!
But as soon as I ...
0
votes
2
answers
240
views
A tool for formatting .csproj files
Is there an option in Visual Studio or a tool (a plugin for VS?) to automatically format .csproj files if they get messed up after eg. a merge conflict resolution? Preferably format them the same way ...
1
vote
1
answer
60
views
Resharper concatenates strings when I do not want it to
I am editing this code with Resharper enabled.
var result = DialogService.Confirm("Save Changes?", message,
"Save" + "Discard");
The second line is supposed to be ...