resharper

Warning on == used on references (Visual Studio or ReSharper)

心不动则不痛 提交于 2020-01-06 04:54:06
问题 According to the documentation of the == operator in MSDN, For reference types other than string, == returns true if its two operands refer to the same object. But, to be honest, I never check if two references are the same with == . I prefer using ReferenceEquals(obj1, obj2) and so do the default override of the Equals function. Therefore, in my projects, when the == operator is used on other types than string, equals to a bug. Is there a way to trigger a warning/error through Visual Studio

Resharper 7 on VS2012 ignores assembly redirect in app.config

左心房为你撑大大i 提交于 2020-01-03 19:33:11
问题 We use moq and AutoMoq with mstest, and since upgrading to VS2012 and ReSharper 7, we the tests run fine with mstest, but fail when using the R# unit test runner with: Test method [...] threw exception: System.IO.FileLoadException: Could not load file or assembly 'Moq, Version=3.1.416.3, Culture=neutral, PublicKeyToken=69f491c39445e920' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) AutoMoq is

Disable Resharper with comment

走远了吗. 提交于 2020-01-03 17:48:12
问题 Edit: Problem is solved by updating. Resharper is really annoying me and marking code that is 100% correct as wrong, it keeps wanting me to change an Action to an Action<T1,T2...Tn> when this obviously incorrect. It flashes everytime I type something so is really distracting. Is there a way to disable resharper totally inbetween two comments? Or how do you disable only for this warning? Edit: There is no hint on the left to disable this using comments. The menu that pops up when you press Alt

I'd like a warning about circular namespace dependency

有些话、适合烂在心里 提交于 2020-01-03 17:25:44
问题 I can arrange my code in assemblies to enforce proper namespace dependancies: Company.Product.Domain assembly Company.Product.DataAccessLayer assembly -References Company.Product.Domain Company.Product.Application assembly -References Company.Product.Domain -References Company.Product.DataAccessLayer Because circular assembly reference is not possible, I can be sure I am not referring to the DAL from within the Domain for example. But this leads to a large number of assemblies when you have

ReSharper's static analyzer appears to be corrupted. How do I fix it?

荒凉一梦 提交于 2020-01-03 17:06:23
问题 I'm having a problem with ReSharper giving obviously wrong advice. For example, in the following code sample, ReSharper is saying that the response , dates , and ex variables are never used, when they are clearly used on the following lines: Dim response As New WcfResponseBoolean Try ' ReSharper identifies 'b' as unused, but it is used on the next line. b = Builders.CastBuilderFromSession If b Is Nothing Then response.SetSessionExpired() Return response End If ' ReSharper identifies 'dates'

How to change the font size of Resharper?

自作多情 提交于 2020-01-03 14:01:08
问题 How to change the font size of the Resharper? I found the font size of File Structure, Live Templates and other UI components unbearably small. I couldn't find any options to customize font size. I tried to increase Windows DPI to 150%. That works but cause a lot of other problems. I'm using Resharper 5.1.3. Thanks 回答1: ReSharper still uses system font settings for many of its controls. Use the Control Panel to change font size in these controls. 回答2: Same as changing the colors, it's in

Why does ReSharper think that “thread.Name == null” is always false? [closed]

拈花ヽ惹草 提交于 2020-01-03 08:49:35
问题 This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 7 years ago . I am writing a helper method for conveniently setting the Name of a Thread : public static bool TrySetName(this Thread thread, string name) { try { if

Why does ReSharper think that “thread.Name == null” is always false? [closed]

笑着哭i 提交于 2020-01-03 08:49:02
问题 This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 7 years ago . I am writing a helper method for conveniently setting the Name of a Thread : public static bool TrySetName(this Thread thread, string name) { try { if

AngularJS unit testing with ReSharper

南笙酒味 提交于 2020-01-03 08:32:22
问题 I'm trying to get Jasmine unit tests for an AngularJS controller running with the ReSharper test runner so I can run my client and server-side tests in one place within VS 2012. I'm running into an issue where the ReSharper test runner is failing with a message of "Inconclusive: Test wasn't run". The same test runs fine using the test runner that comes with the AngularJS Seed project. Here's my simple test for troubleshooting: /// <reference path="~/Scripts/angular/angular.js"/> ///

Use ReSharper to arrange members in the same order as implemented interface

安稳与你 提交于 2020-01-03 06:50:10
问题 Is it possible to use the Type Layout feature of ReSharper to sort the members that implements an interface in the same order as they were declared in the interface? 回答1: No, unfortunately you can't do that directly. But, like Kirill said, you can use the same rules to let them order. Additionally you can let Resharper group members of an interface into one region by modifying the CodeCleanup profile: <Group> <ImplementsInterface Immediate="true" Region="${ImplementsInterface} Members"/> <