resharper

Rearrange Code shortcut in Resharper doesn't work in VS2015

纵然是瞬间 提交于 2019-12-09 18:38:03
问题 When I try to use the shortcut for moving lines up/down ( Ctrl + Alt + Shift + ↑ / ↓ ), it highlights the code and shows the tooltip message "Use Up/Down to move text line" but nothing happens. If however I try the same command via the menu bar (Resharper > Edit > Rearrange Code > Move Up) it moves the selected lines as expected. I used to use this feature all the time so I find this bug very annoying. Apparantly, others also experience this (see comments for Resharper move line up down not

C# sizeof(enum) alternative? (to workaround resharper false error)?

扶醉桌前 提交于 2019-12-09 17:46:40
问题 In C# I've got some "safe" API code related to UAC elevation. It involves getting the size of an enum (as follows) int myEnumSize = sizeof (MyEnum); The code itself is valid, compiles, works correctly etc. But Resharper falsely flags it as a an error ("Cannot use unsafe construct in safe context") within the solution. (Starting with version 2.0 of C#, applying sizeof to built-in types no longer requires that unsafe mode be used.) I love Resharper, and I love the solution analysis, but with

Resharper always suggesting me to make const string instead of string

守給你的承諾、 提交于 2019-12-09 15:12:20
问题 which one is good: string sQuery = "SELECT * FROM table"; or const string sQuery = "SELECT * FROM table"; And why resharper always suggest me to do this? 回答1: The latter is better - it means that: This isn't an instance variable, so you don't end up with a redundant string reference in every instance that you create You won't be able to change the variable (which you presumably don't want to) There are some other effects of "const" in terms of access from other assemblies and versioning, but

Stop ReSharper from Adding Annotations

允我心安 提交于 2019-12-09 14:20:20
问题 I'm using ReSharper in my C# projects, and generally I love it. However, it keeps adding annotations to the code when I do certain refactoring actions. For example, it adds [NotNull] when I use the "Check parameter for null" context action: // Before context action public void Foo(object input) { } // After context action public void Foo([NotNull] object input) { if (input == null) { throw new ArgumentNullException("input"); } } Additionally, ReSharper then adds using JetBrains.Annotations to

C# @ modifier for methods parameters

北战南征 提交于 2019-12-09 14:04:11
问题 I was using ReSharper plugin on VS2010 and i was generating an interface method. ReSharper put an @ on the parameter name. WHat is that used for? int Count(Func<ContratoList, bool> @where); Whats the difference for int Count(Func<ContratoList, bool> where); Thanks! 回答1: The @ symbol allows you to use reserved words in a variable name. int @class = 1; void MyMethod(int @goto); bool @public { get; set; } As Marc correctly pointed out in his comment and his answer, ReSharper is actually wrong to

Resharper 7: MSTest not working - “Test wasn't run”

爷,独闯天下 提交于 2019-12-09 14:03:38
问题 Since I upgraded to VS2012 and Resharper 7, my previously working MS Tests are not running anymore. The tests are run in an ASP.NET environment. I use the following Attributes: [TestMethod] [HostType("ASP.NET")] [AspNetDevelopmentServerHost("C:\\Projekte\\****\\Website", "/")] [UrlToTest("http://localhost:7924/")] Any idea how to fix this? 回答1: As odd as it is, using VS2012, using Resharper 8.0, using NUnit, I was receiving this error because of an entry in my app.config file. I added an

Resharper 'Ctrl + Alt Click' isn't working with visual studio 2017

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-09 14:02:01
问题 I installed vs 2017. And found that functional that I use every time isn't working anymore.Ctrl + alt click don't go to implementation ,it goes like 'ctrl click',to declaration. 回答1: After some searching I found a solution . Need to uncheck visual studio settings 来源: https://stackoverflow.com/questions/46792639/resharper-ctrl-alt-click-isnt-working-with-visual-studio-2017

Resharper reformatting Linq statement to put into and select on same line

 ̄綄美尐妖づ 提交于 2019-12-09 13:05:30
问题 When I type in a Linq query style statement like var stuff = from x in things group x by x.Something into g select g; Resharper is reformatting it to var stuff = from x in things group x by x.Something into g select g; And then complains about it because it breaks the StyleCop rule SA1103. Is this a bug in Resharper or is there some combination of settings that I need to change to keep it from doing this reformatting? Edit JetBrains has confirmed that this is a bug and it is fixed in version

Is it possible to copy / paste References from one project to another in Visual Studio?

半腔热情 提交于 2019-12-09 07:53:33
问题 Is there a way or tool that lets you to copy some references from one project and paste them to another -so that I do not bother my self again by using ADD REFERENCE? 回答1: Yes, you could use the Power Commands extension to copy and paste references in VS2010. 回答2: I had the same question in Visual Studio 2013 Preview. I couldn't find any "Power Commands" extensions yet, so I did it manually. Unload the source project. Edit Copy contents of tag tag that lists the tags. Unload the target

ReSharper complains about uppercase “ID” in member “EntityID”

喜欢而已 提交于 2019-12-09 05:04:07
问题 I have a property "EntityID" in a class. Resharper (5.1) says Name 'EntityID' does not match rule 'Methods, properties and events'. Suggested name is 'EntityId'. But IMHO according to the naming conventions in the Design Guidelines for Class Library Developers. 'EntityID' should be perfectly fine: Do not use acronyms that are not generally accepted in the computing field. Where appropriate, use well-known acronyms to replace lengthy phrase names. For example, use UI for User Interface and