resharper

Why is ReSharper telling me that “User.Identity == null” will always be false?

做~自己de王妃 提交于 2019-12-23 06:55:58
问题 I have a simple property inside one of my ASP.NET MVC Controller classes. I've seen this many times before, so understand what the message means, but usually it makes perfect sense. This, however, doesn't. To get to the underlined statement, User would have to NOT be null, so the check for User.Identity is fine. The Identity property is part of the IPrincipal interface, and returns an object that inherits IIdentity. To inherit this interface, or any interface for that matter, this property

Help configuring MSpec

半腔热情 提交于 2019-12-23 03:44:12
问题 rig: win7 64bit, vs2010, mvc v2, TestDriven.Net 3.0, Reshaper 5.0, MSpec 0.3 i recently started a new project and want to use mspec. (1) copied Machine.Specifications.ReSharperRunner.5.0.dll and Machine.Specifications.dll to JetBrains\ReSharper\5.0\Bin\Plugins\Machine.Specifications (2) copied Machine.Specifications.TDNetRunner.dll to TestDriven.NET 3\Machine.Specifications when i try to run the test i get this error: System.IO.FileNotFoundException: Could not load file or assembly 'Machine

Visual Studio 2010 crashes upon editing a C# string literal

强颜欢笑 提交于 2019-12-23 02:53:27
问题 My VS2010 Premium RTM installation has developed a nasty habit of crashing when I edit a string literal. It 'feels' like the Intellisense bug and I have an unreasonable and unsupported hunch that this has something to do with ReSharper, because the ReSharper integrations get slower and slower until finally the crash happens when I edit a string literal. This is happening on two seperate PCs so it is not PC-specific. My R# build is: 5.1.1751.8 dated 2010-08-31. Anyone else seeing this? Any

Can I generate class and method summaries with ReSharper

穿精又带淫゛_ 提交于 2019-12-23 02:43:17
问题 I need a convenient way to generate stub of class or method summary in C#. Like this sample summary: public class TestClass { /// <summary>DoWork is a method in the TestClass class. /// <para>Here's how you could make a second paragraph in a description. <see cref="System.Console.WriteLine(System.String)"/> for information about output statements.</para> /// <seealso cref="TestClass.Main"/> /// </summary> public static void DoWork(int Int1) I wasn't able to find such feature out of the box in

Is there a way to disable resharper code analysis for a single file using a comment?

。_饼干妹妹 提交于 2019-12-23 02:28:42
问题 Is there a way to disable resharper code analysis for a single file using a comment? I'm generating code with 100's of class in a single file and I'd rather not have resharper to code analysis on that file. I'm talking about the following: https://www.jetbrains.com/help/resharper/2016.1/Speeding_Up_ReSharper.html#d235354e43 Disable code analysis for specific files You can tell ReSharper to skip analyzing certain files without opening them. For example, you can skip files that contain well

Only keep used types and remove unused types

对着背影说爱祢 提交于 2019-12-22 10:57:42
问题 Is there any way to remove unused types/code from a project. lets say I'm using NAudio (source code) in my console application and I'm only using the WaveIn class from it. Is there any way for me to remove unused classes from the code and only keep the WaveIn class and the classes WaveIn depends upon? Something down the line of tree shaking 回答1: Ndepend was the answer from t in Types let depth0 = t.DepthOfIsUsedBy("NAudioTrim.Program") where depth0 >= 0 orderby depth0 select new { t, depth0 }

Jasmine + Pahtom.js + ReSharper : Test session don't stop after execution

筅森魡賤 提交于 2019-12-22 10:42:17
问题 I write my JS tests using Jasmine and execute then with Phantom.js (1.8.1) on ReSharper (7.1) Everything runs smoothly as ever, exept that the ReSharper Testrunner's Test Session is not stopped after all unittests are run. The result is that everytime I run a new unittest, it opens another Unittests session, and all the other open sessions have the "executing animation". Any ideas how to get the test session to stop when all tests are run? 回答1: This is a known problem for ReSharper, I've open

Visual studio 2010: limiting the number of editor tabs

牧云@^-^@ 提交于 2019-12-22 10:27:26
问题 Visual studio doesn't appear to limit the number of opened editor tabs. I'm using ReSharper and at a certain number of opened editor tabs things get really slow. So I have to keep track of opened tabs and periodically close old ones. It would be cool if I could set a limit so that it would close old tabs when the limit is reached. Is there a setting in VS / ReSharper or any VS addons that can help to achieve this? 回答1: I'm trying to solve this with a primitive addin at the moment. Seems to be

Resharper thinks that typecast is redundant, but without typecast the code does not work

时光毁灭记忆、已成空白 提交于 2019-12-22 09:57:10
问题 Iterating JsonData through foreach fetches IDictionary enumerator instead of IList one. foreach (var jsonEntry in jsonData) This causes my code to throw an error. InvalidOperationException: Instance of JsonData is not a dictionary LitJson.JsonData.EnsureDictionary () LitJson.JsonData.System.Collections.Specialized.IOrderedDictionary.GetEnumerator () LitJson.JsonData.System.Collections.IDictionary.GetEnumerator () Casting the object to IList causes Resharper to issue a warning "Type cast is

Stack trace for Jasmine test with the Resharper 7 test runner

廉价感情. 提交于 2019-12-22 09:39:37
问题 How do you get the Resharper 7 test runner to show the stacktrace for Jasmine tests. My setup is Resharper 7 (build in Jasmine) testrunner and PhantomJs. When executing any failing test the error message always ends with: Exception doesn't have a stacktrace In the 1.6 "Lavender" version of Phantom has added the feature to print the stacktrace when an error occurs. To replicate this just create a mytest.js file and add the following code to it: describe("A suite", function() { it("contains