4,956 questions
0
votes
1
answer
40
views
Prevent Resharper to modify team shared settings
After an update, Reshaper is modifying my *.sln.DotSettings which is shared with my team. How can I set reshaper to modify GlobalSettingsStorage.DotSettings or .sln.DotSettings.user instead ?
<s:...
0
votes
0
answers
43
views
ReSharper - custom pattern - add newline
I'm looking for a way to format unit test code. My goal ist to have mock verifies on a seperate line.
This:
messageProducer.Verify( x => x.Send( It.IsAny<SendMessage>(), It.IsAny<...
0
votes
1
answer
134
views
Why is Resharper showing an error whose inspection is disabled and whose format style is different?
Resharper shows this error "Line break is missing around parenthesis":
But I have disabled the inspection:
And I adjusted the formatting style, so that there shouldn't have to be a line ...
0
votes
0
answers
43
views
Force Resharper spell-checker not to accept a word
I understand that Resharper's spell checker has a user dictionary which can be set in foo.sln.DotSettings and foo.sln.DotSettings.user. This allows you to add additional words so they won't be ...
0
votes
2
answers
34
views
Why is resharper cleanup code adding a "plus" sign in app.config
When I run ReSharper cleanup code on a project, it adds a plus (+) sign.
Is this a feature, or how do I disable it?
<?xml ver.......>
+
<!--
...
...
-->
0
votes
0
answers
60
views
Define Resharper Rules to check Lambda parameter capture by reference
I wonder, if it is possible to define rules in Resharper, such that, if a Lambda capture a parameter by reference, a warning would be issued?
This is to prevent usage of the Lambda in a later stage, ...
1
vote
1
answer
36
views
How to create a specific "replace refactoring" with its own shortcut?
Say I have a property implementing INotifyPropertyChanged:
public WhichHandle LastHandleFC
{
get => _lastHandleFc;
set => SetField(ref _lastHandleFc, value);
}
I can replace with regex: ...
0
votes
1
answer
58
views
ReSharper - force braces on single line guard clause
There already is a question pretty close to this but not exactly: ReSharper - force curly braces around single line
ReSharper always suggests to invert if loops in order to prevent too much nesting. I ...
1
vote
0
answers
73
views
Resharper Object Browser "Go to declaration" focuses the assembly explorer
I have Visual Studio 2022, and Resharper Ultimate.
I work on game mods, so I often need to look at the original code in order to make decisions. Generally, this comes in the form of decompiled sources....
-1
votes
1
answer
33
views
How to configure Re-sharper Cleanup?
Whenever i run the re-sharper code cleanup on my file in VisualStudio the following happens:
var somevariable = 5 is modified to IVariableType someVariable = 5 or
var variable = new TypeClass() is ...
0
votes
1
answer
86
views
Why do Visual Studio suggestions appear after installing Resharper?
I installed Resharper 2024 in Visual Studio 2022. Usually after installing Resharper, the suggestion of VS are disabled completely but in this case, it appeared. You can see in the screenshot below.
I ...
0
votes
0
answers
69
views
Could not load file or assembly 'txic' or one of its dependencies. An attempt was made to load a program with an incorrect format
This below code will return the following error:Could not load file or assembly 'txic' or one of its dependencies. An attempt was made to load a program with an incorrect format.
using System;
using ...
0
votes
0
answers
46
views
How to find out implicit type conversions in C# code using code analysis way
I'm trying to scan my c# project, to find out which lines have implicit type conversions, then export results to something like a xml file.
ReSharper is a probable resolution.I installed the ReSharper ...
1
vote
2
answers
120
views
C# Linq statement block-style alignment
I'm working with Rider/ReSharper and formatting C# code in block style to improve readability. I can't find (in the settings or on the internet) a way to format LINQ statements as follows:
static Game&...
1
vote
1
answer
166
views
Dapper - Unable to resolve property
I am trying to create a create method which will insert rows into my database.
Table
This is my database table. As you can see it has an accountId column
CREATE TABLE [dbo].[Transactions](
[Id] [...
0
votes
0
answers
20
views
Prevent Visual Studio 2022 from autocompleting html on > or space
I am using Visual Studio 2022 with the Resharper plugin. I am unsure which of these two is causing the issue.
I am working on a Razor Page in a Blazor project (.razor file)
I start typing an html ...
0
votes
0
answers
64
views
Force (Resharper?) code format to allow all method parameters on single (but new) line
I updated ReSharper yesterday to version 2024.3.20241113.1046. Now I get tons of formatting errors.
I looked through all of the resharper code format options, but I cannot figure out how to tell ...
0
votes
1
answer
109
views
Is it possible to change the colour / color of a C# class based on the type in Visual Studio / Rider / R#
We have .NET 8 C# classes that inherit from Event and Command.
It would be nice to see the Something : Event class in a different color within the IDE.
Is there a R# plugin that can color classes ...
1
vote
1
answer
95
views
Unit test performs better when started from ReSharper Test Session?
I have a unit test including a stopwatch measuring the execution time of certain .NET library calls.
I get significantly shorter execution times when I start the unit test from ReSharper Test Session ...
0
votes
1
answer
310
views
ReSharper Test Runner Ignores `.runsettings` File, But Visual Studio Test Runner Works
I am facing an issue where the .runsettings file is not affecting the execution of my tests when I run them through the ReSharper test runner. However, when I run the tests using Visual Studio’s built-...
1
vote
2
answers
563
views
Why does ReSharper dislike ArgumentNullException.ThrowIfNullOrEmpty(string)?
I am using ReSharper 2024.2 and still I get the suggestion that I should not be using the following code:
public async Task<T> GetQueryAsync<T>(string query, bool isToBeValidated = ...
2
votes
1
answer
112
views
Add custom refactoring pattern using Resharper
I have hundreds occurences of this kind of lines in my app :
public ICommand MyCommandName => ReactiveCommand.Create(TriggerCommand);
I tried without luck to add a Custom Pattern in resharper to ...
0
votes
0
answers
85
views
How to fix autoformat with VS 2022 and Resharper
I have this code:
which gets automatically reformatted into one long line and it is driving me nuts.
When I open resharper's options (no matter which cs-file), it says:
Which apparently means that ...
0
votes
1
answer
232
views
How to copy FULL compiler error message in VS2022
In a VS2022 C# project, how can I get (copy) the full error message from the compiler?
For example, when an ambiguity is found, it looks like this in the editor window:
But in the Error List window ...
5
votes
0
answers
69
views
Do C# pattern expressions short circuit like if statements do? [duplicate]
I have the following line of code.
if (_lazyHeightMap.IsValueCreated && _lazyHeightMap.Value is { IsEmpty: false })
I make the first check because I do not want my code to attempt to retrieve ...
0
votes
2
answers
60
views
Resharper rearrange implementation of interface
I have this code:
public interface IMyClass
{
void DoStuff();
int MyProperty { get; set; }
}
public class MyClass : IMyClass
{
public void DoStuff()
{}
public int MyProperty { get;...
0
votes
1
answer
51
views
Resharper C++ doesn't replace the existing parenthesis after entering function parameters
I'm using ReSharper 2024.1.2 on a C++ VS2022 project. I have an issue with something very basic, but I couldn't find a solution.
When I type auto-complete a method name, the cursor gets between the ...
4
votes
0
answers
88
views
Getting different nullable reference types results between LINQ query syntax and the equivalent method syntax
I'm using Visual Studio 2022 (with ReSharper 2024.1 but I don't think that's relevant) developing in .NET 8. My minimal repro is this:
public class Program
{
public static void Main()
{
...
1
vote
1
answer
206
views
How to disable Resharper TYPE "Tab to accept" suggestion
I've recently installed ReSharper to my Visual Studio 2022, and when I use the "prop" + tab + tab to create a class property, I can rename the type and the property name normally.
The ...
2
votes
2
answers
121
views
Will LINQ Any() ever enumerate without arguments?
Given the following:
var nums = GetNums();
Console.WriteLine(nums.Any());
Console.WriteLine(string.Join(", ", nums));
static IEnumerable<int> GetNums()
{
yield return 1;
...
0
votes
1
answer
164
views
How to Share ReSharper Configuration Across Multiple Git Repositories
I'm working on several projects across different Git repositories, and I want to maintain a consistent ReSharper configuration across all of them. To achieve this, I'm considering storing the ...
0
votes
1
answer
47
views
How to stop visual studio DO NOT add 'require' header for my javascript file?
When I write js code in visual studio, sometimes stange 'require' headers was added to the header of my js file, I don't know whether it was done by visual studio or resharper(this is the only ...
1
vote
1
answer
161
views
Is it possible to stop Resharper from offering to import specific namespaces?
I love how Resharper offers to import namespaces when I put in code from them.
But for this particular, namespace ("OpenCvSharp"), I actually want to prevent it from being imported because ...
0
votes
1
answer
582
views
Run coverage test with dotCover on ASP.NET application
I have written a series of tests against the front end of my web application. I really wanted to know what my test coverage looked like, so I downloaded and installed ReSharper and dotCover. These ...
0
votes
1
answer
236
views
Intellisense in ReSharper 2024.1.2 extension for Visual Studio 2022 can sometimes stop providing suggestions upon pressing Ctrl + J (C#)
Sometimes ReSharper's IntelliSense just stops working for no reason until I manually invoke it, then it continues to operate as if nothing happened. Has anyone experienced this issue?
0
votes
1
answer
27
views
How to stop Resharper_LineComment from moving to the below line?
As the title says, it's frustrating since the behaviour is different from stock Visual Studio. I also couldn't find a setting for it anywhere. I'd like the cursor to stay where it is when I comment ...
0
votes
1
answer
74
views
Can the ReSharper spell checker detect written out umlauts?
When I use German words for my variable names and these include umlauts or special characters, I write those out so the names are completely written in the normal latin alphabet. ReShaper marks those ...
0
votes
1
answer
75
views
how to get all types of file(s) path in Rider Plugin
I have a Rider plugin that gets the local path of the opened file in Rider. It is a context menu button. It is now only able to get the path of certain project files such as C# files.
It is not able ...
0
votes
1
answer
61
views
Why does the TeamCity Inspection step not always apply the naming rules according to a consistent pattern?
We use TeamCity Professional 2024.03 (build 156166) on-premises.
The code inspection step does not apply the naming rules described in CleanCode.sln.dotsettings according to a consistent scheme.
We ...
0
votes
1
answer
263
views
ReSharper not applying the 'new' parenthesis space formatting rule in Code Cleanup
It is not a duplicate question. Because my question asks why Resharper stopped making spaces, however, another question is asking how to add spaces. It is two different questions.
I've set a settings ...
0
votes
1
answer
124
views
Boxing allocation in Composite Formatting
In Rider Resharper suggests to simplify string interpolation.
When doing so, the Heap Allocation Viewer plugin warns me about boxing allocation. And indeed, the IL code is different and when running ...
0
votes
1
answer
236
views
Visual Studio & Resharper: Rename class only in current project and not entire solution
I have a solution with many projects in it.
Two projects both have a class with the same name. Lets call them project A and project B.
When i use resharper rename feature (Ctrl+R -> R) in project B ...
1
vote
2
answers
85
views
What is "Capture namespace name"?
I have this line of code somewhere:
Sys.Attribute? testClassAttribute = Helpers.TryGetAttributeByFullName( type,
"Microsoft.VisualStudio.TestTools.UnitTesting.TestClassAttribute" );
...
0
votes
1
answer
71
views
Where do I configure the severity for R# code inspections?
I currently get red squiggly lines for a non-explicit converting constructor. That's superb! My colleagues want that, too. Where the heck did I configure that?
I am quite sure that this is a Jetbrains ...
0
votes
1
answer
46
views
How to disable auto unwrapping region after i accept Resharper InteliSense autocomplite
After i accept Resharper InteliSense autocomplite, all my wrapped regions become opened and caret return to first line of code in xaml and c# code. How to deal with it?
i didnt found in reshaper ...
0
votes
1
answer
262
views
Is that possible to annotate a method NotNull in Rider with a non-invasive way
When I using pessimistic value analysis mode, I got hundreds of null related warning. I want to remove them in a non-invasive way.
For example, there is a method in my source code, and I want to ...
1
vote
1
answer
65
views
Resharper data annotation on single line
Im kind of new to resharper; but old on c#
I have a problem with the resharper config and on my team no ones knows how to solve it.
I have this:
[Required]
public ushort SemanticId { get; set; }
...
1
vote
0
answers
680
views
Predeploy JetBrains ReShaper Activation Method 'Use License Server' Setting in Visual Studio
We're using the latest (currently 2023.3.3) versions of JetBrains ReSharper/ReSharper C++ on our workstations along with "JetBrains Floating License Server" to handle licensing.
We're using ...
1
vote
1
answer
527
views
VS2022 + ReSharper broken keyboard shortcut for navigate to Solution Explorer
I am using a fresh install of VS2022 (17.8.6) and ReSharper (2023.3.3). When editing a source file, the keyboard shortcut Ctrl + [, S does not behave as expected according to the docs. It should ...
0
votes
1
answer
42
views
Resharper template quick menu showing more entries than configured
Just started using Resharper file templates, but the quick list has more menu entries than I would expected. Please see the following screenshot.
Left side shows what I have configured for the ...