resharper

Resharper 8.1 Test Runner slowing down Visual Studio Text Editing

孤街醉人 提交于 2019-12-19 05:33:10
问题 I've got a fairly small C# solution with about 5 projects in it. I am using Visual Studio 2012 with Update 4, and Resharper 8.1 (build 8.1.23.546). It's on an I7 with an SSD and 16GB RAM, with oodles of disk space. Performance on this machine is fantastic for everything else. I have R# set to be my unit test runner, and I've noticed that as soon as I run any unit tests (one or many, pass or fail, makes no difference), the Visual Studio text editor becomes almost unusable. Typing into the

Is using “base” bad practice even though it might be good for readability?

穿精又带淫゛_ 提交于 2019-12-19 05:19:28
问题 I know this is a subjective question, but I'm always curious about best-practices in coding style. ReSharper 4.5 is giving me a warning for the keyword "base" before base method calls in implementation classes, i.e., base.DoCommonBaseBehaviorThing(); While I appreciate the "less is better" mentality, I also have spent a lot of time debugging/maintaining highly-chained applications, and feel like it might help to know that a member call is to a base object just by looking at it. It's simple

How to have a file open normally in Resharper instead of in “Keep Open” mode

两盒软妹~` 提交于 2019-12-19 05:06:11
问题 I'm using Visual Studio 2012 Ultimate and Resharper and whenever I search for (and open a file) by name (using the "Go To File" shortcut of Control-Shift-T) the file opens in a "Keep Open" mode, instead of opening normally. I've searched and can't find anyway to open the file normally. What setting can I change to make it open normally? 回答1: Simply go to : Tools >> Options >> Environment >> Tabs and Windows Then uncheck the "Allow new files to be opened in the preview tab" in the Preview Tab

Adding a Visual Studio toolbar button for a command that is only available as a keyboard shortcut

对着背影说爱祢 提交于 2019-12-19 04:03:03
问题 This question relates to this ReSharper YouTrack issue. In Visual Studio 2010 with ReSharper 7.1.1 installed, if I go to Tools > Options > Environment > Keyboard, there is a command called ReSharper_SilentCleanupCode. I would like to bind this command to a toolbar button. This seems to be impossible using Tools > Customize > Commands because the only commands available within this dialog are for actions that already have an associated menu item. The particular ReSharper command I'm interested

Find usage of property from base entity

北慕城南 提交于 2019-12-19 03:46:11
问题 I'm trying to find the usage of a property in a class where the property belongs to a base class. Here is a token example: class Program { class Item { public DateTime DeletedStamp { get; set; } public decimal Price { get; set; } } class Book : Item { public string Title { get; set; } public string Author { get; set; } } class Bicycle : Item { public string Type { get; set; } public string Producer { get; set; } } static void Main(string[] args) { var book = new Book() { Title = "Atlas

How to extract common/similar code blocks to function in Visual Studio C#

蓝咒 提交于 2019-12-19 03:44:10
问题 I want to select code, e.g. doSomething(myEnum.firstThing) doSomethingElse(myEnum.firstThing) evenMoreStuff(myEnum.firstThing) and convert it to a function GroupCommonStuf(myEnum.firstThing) which would look like: GroupCommonStuff(myEnum id) { doSomething(id) doSomethingElse(id) evenMoreStuff(id) } Preferably it would catch any code that is: doSomething(myEnum.secondThing) doSomethingElse(myEnum.secondThing) evenMoreStuff(myEnum.secondThing) and convert it to GroupCommonStuf(myEnum

Resharper “Cannot resolve symbol” when the code well-compiled

烈酒焚心 提交于 2019-12-19 02:47:17
问题 I believe, the error message not related to Serilog specifically, but is rather because of the code/assembly/package specific structure/modifiers etc. So, the issue is that Resharper shows the error (and the code (from assembly referenced) is not accessible for navigation to) when Visual Studio navigates (by Go to Definition command) to metadata and compiles the code well (including, showing the method description successfully as well). The method is defined in assembly as follows: namespace

Resharper formatting code into a single line

夙愿已清 提交于 2019-12-18 21:26:12
问题 I am having an issue with formatting code with Resharper. I have disabled the option for wrapping lines. With this option, the following code will be formatted to a single line. Does anyone have an idea how to have Resharper not format the following code? Mapper.CreateMap<CountryEntity, Country>() .ForMember(dest => dest.CreatedBy, map => map.MapFrom(src => src.CreatedBy)) .ForMember(dest => dest.DateCreated, map => map.MapFrom(src => src.DateCreated)) .ForMember(dest => dest.Id, map => map

ReSharper Unit Test Runner - TestCase

半世苍凉 提交于 2019-12-18 19:40:22
问题 I like using the ReSharper unit test runner, but it doesn't support the TestCase attribute that was added in NUnit 2.5. Is there any hack to get round this? I can obviously use another test runner, but I like the ReSharper one. 回答1: I love ReSharper, but it does not yet support [TestCase]. However, take a look at the Gallio plug-in for ReSharper which does. http://www.gallio.org/ 回答2: Another solution that I use on Resharper version 5 is to use aspects with your tests. I'd love resharper 6

Anonymous Type to Real Class Refactoring

给你一囗甜甜゛ 提交于 2019-12-18 15:40:34
问题 Is there an easy way to refactor an anonymous type into a class? I frequently prototype my code with anonymous types, then have to go back and re implement the various classes as they need to be used beyond their local scope. I am using resharper and wondering if there is an easy way to do this. 回答1: Using ReSharper 5.1 (I would expect this has been available since version 4, the first with C# 3.0 support) , with the cursor anywhere from just before the new to just after the closing } in this