resharper

Visual Studio removes line break on start

陌路散爱 提交于 2019-11-28 20:16:33
问题 I have the problem that Visual Studio (or maybe Resharper?) removes line breaks when I try to start my application. This happens in a way that when I press F5 or click on the run button with the mouse that a line break at the line where the cursor was the last time will be removed which is extremely annoying. I have not tried so many things yet because I really don't know where to start. I never experienced this problem before and was always working with the same setup: Visual Studio 2010

Code editor appears blank

自作多情 提交于 2019-11-28 20:09:49
I was using ReSharper with visual studio 2015 and my pc got really slow because of ReSharper and i had to uninstall it. After uninstallation completed when i opened up my project the only thing i saw was a blank screen like this. I know that uninstalling ReSharper caused it and i looked and tried to fix it by changing Text Editor options but nothing worked so far. I've also searched about this issue and nothing came across yet. Thanks This error is caused by a corrupted Visual Studio cache. Close all Visual Studio tasks that are running, and delete all files in the folders ComponentModelCache

ReSharper - force curly braces around single line

こ雲淡風輕ζ 提交于 2019-11-28 19:26:24
问题 Can I configure ReSharper to fix C# code when curly braces are not used to surround a single-line code block, like this: if (blnSomeCondition) DoSomething(); // complain if (blnSomeOtherCondition) { DoSomethingElse(); // don't complain } Thanks 回答1: In the new version of ReSharper (2016.x) is has been moved to the Code Style. UPD1: for ReSharper 2017.x UPD2: for ReSharper 2018.x UPD3: for ReSharper 2019.x 回答2: Ryan is correct (note however that the his link refers to R# 2.0 help). The

autoformat code from command line

偶尔善良 提交于 2019-11-28 19:22:09
Is it possible to run auto-format code for all or for specific file in solution, like (Ctrl+K, Ctrl+D) formatting in Visual Studio but from it`s command line? Or use Resharper's cleanup also from command line for solution files? To format net core c# source, use https://github.com/dotnet/format Install the tool as per the project readme. I had a need to format some code files I was generating from Razor templates. I created a shell .CSProj file in the root of my output folder, using dotnet new console which gives you this basic file: <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup>

Detect Recursive calls in C# code

非 Y 不嫁゛ 提交于 2019-11-28 18:47:35
I want to find all recursive calls in my code. If I open file in Visual Studio, I get "Recursive call" icon on left side of Editor. I want to inspect whole solution for such calls. I used Resharper Command Line tools and VS's add-in Resharper - Code Inspection with no luck, this rule is not applied in their ruleset. Is there any way that i could inspect whole solution - i really don't want to open each file and check for that blue-ish "Recursive call" icon :) Edit: I am interested in single-level recursion You could do it with Mono.Cecil . Here is a simple LINQPad program that demonstrates:

Could string comparisons really differ based on culture when the string is guaranteed not to change?

心已入冬 提交于 2019-11-28 18:32:14
I'm reading encrypted credentials/connection strings from a config file. Resharper tells me, "String.IndexOf(string) is culture-specific here" on this line: if (line.Contains("host=")) { _host = line.Substring(line.IndexOf( "host=") + "host=".Length, line.Length - "host=".Length); ...and so wants to change it to: if (line.Contains("host=")) { _host = line.Substring(line.IndexOf("host=", System.StringComparison.Ordinal) + "host=".Length, line.Length - "host=".Length); The value I'm reading will always be "host=" regardless of where the app may be deployed. Is it really sensible to add this

Disable code analysis for current file in ReSharper

孤街浪徒 提交于 2019-11-28 18:26:19
问题 In ReSharper 4.x there was a shortcut (Ctrl+8) for turning off the code analysis for the current file, but I cannot find the equivalent in ReSharper 5.0. Anyone knows where to find it? The reason I want this is because I want to disable ReSharper when editing XAML-files (because it's just incredibly slow...), and I don't want to go through the dialog under "Options > Code Inspection > Settings > Edit items to skip" for each and every xaml-file. And I want to turn it back on temporarily when I

Resharper move line up down not working

房东的猫 提交于 2019-11-28 18:18:48
问题 I can't make it working, move line up or down doesn't work. When I reset keyboard for VS and applay scheme for Resharper it ask me for this : and if I take first selection , then alt + up switch me between methods, if I use second selection then this combination does not effects. 回答1: Alt + Up is not a ReSharper shortcut to move a line. It most likely belongs to the Productivity Power Tools extension, that has a feature to move one or more (selected) lines. Personally, I don't like this

Is there a way to disable ReSharper for a specific file?

安稳与你 提交于 2019-11-28 17:43:14
I want to tell ReSharper to ignore a few files in my project. Some of them are just too large (they contain canned test data). Some of them are just confusing it (with a mishmash of Silverlight and .NET code). Is there a way to do this by putting a comment at the top of the file? However it's done, it needs to be persistent (i.e. can be checked in), and per-file. I found this , but it doesn't appear to be persisted. In order to skip inspections in some files or folders go to ReSharper | Options | Code Inspection | Settings -> Edit Items to Skip button. Or if your code is generated add it to

Visual Studio 2012: change setting for “Enable floating tab wells”

五迷三道 提交于 2019-11-28 17:30:32
I'm having troubles with VS2012 and code opened in separate windows. See this screenshot: Main windows is open, another window is open (Source Control explorer is just an example for the screenshot, I get the same behavior with source code files). I used to get two items on the task bar for the Visual Studio. Now it is only one. There is a setting for this: But I can't get it undone. Every time I un-check this setting, I get a flicker of another item in task bar, but it goes away immediately. Then I go back to the same settings, the checkbox next to "Floating tab wells always stay on top" is