resharper

Adding Resharper code annotation to own code in a non-invasive manner

时光毁灭记忆、已成空白 提交于 2020-01-01 09:05:34
问题 I want to flag one of my methods with the StringFormatMethod attribute so Resharper syntax highlights it. I was able to do this by referencing the JerBrains.Annotations assembly and adding the attribute. However I find this to be a very invasive way to do this. Not everybody here uses JetBrains and it will require committing the .dll to subversion, adding the dependency and littering the code with something that is specific to a particular IDE, which I hate. I read about the "external

resharper + VS Black theme makes Note: and TODO: Blue and hard to read

别等时光非礼了梦想. 提交于 2020-01-01 04:08:05
问题 I have a Black theme for the visual studio editor and it was ok until I've installed resharper. After this my TODO and Note text got really impossible to read, anybody knows a fix for that ? 回答1: You can change your text and theme colors by just going to the Tools menu, and choosing Options --> Environment --> Font and Colors. Look for the entry "Resharper Todo Item", and change it as needed. 回答2: I use a black (well, dark blue) theme. You can change the ReSharper colour scheme in the same

Best way to handle a NULL

[亡魂溺海] 提交于 2020-01-01 04:02:26
问题 At the top of my functions I'm trying the best way to handle a null coming into my procedures in C#. Which is the best way for checking and handling the null and why? I've added the complete code of what I'm using right now and Resharper is telling me to use Option #1. Normally I do what it says as I understand why it makes it more efficient. This time though I'm not sure so I must ask. Option #1 if (sender == null) return; // Code goes here or Option #2 if (sender != null) { // Code goes

ReSharper intellisense does not display documentation

你。 提交于 2020-01-01 01:29:12
问题 Any idea why I'm not getting any documentation to go along with my ReSharper IntelliSense? If I go to the ReSharper options and enable the Visual Studio IntelliSense instead, I get the proper documentation when going through the members in the IntelliSense pop up. If I re-enable the ReSharper IntelliSense, I now get the ReSharper IntelliSense pop up sans documentation. 回答1: Go to ReSharper | Options -> Environment | IntelliSense | Completion Appearance . Check Show member signatures and Show

DisconnectedContext error when running Unit Tests in debug in VS2015

我的未来我决定 提交于 2019-12-31 11:42:10
问题 I have this problem with running unit tests in VS2015 Enterprise. Whenever I run any unit test in debug mode, I get the following error: Managed Debugging Assistant 'DisconnectedContext' has detected a problem in 'my_path_to_VS\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\TESTWINDOW\te.processhost.managed.exe'. I tried running repair on VS2015 and it did not help. Tried uninstalling and installling again and the issue persist. The strange thing that I have a code on SVN and my friend in able to run

Possible multiple enumeration of IEnumerable? [duplicate]

♀尐吖头ヾ 提交于 2019-12-31 10:40:14
问题 This question already has answers here : Handling warning for possible multiple enumeration of IEnumerable (7 answers) Closed 5 years ago . why is that ? how can I fix it ? 回答1: There is nothing to fix here. Any() will iterate the enumeration but stop after the first element (after which it returns true). Multiple enumerations are mainly a problem in two cases: Performance: Generally you want to avoid multiple iterations if you can, because it is slower. This does not apply here since Any()

Are there shortcut keys for ReSharper's Unit Test Runner?

本小妞迷上赌 提交于 2019-12-31 08:16:13
问题 For obvious productivity reasons, I make an effort of learning and using as many of the keyboard shortcuts for the various Re# commands. However, it seems that the unit test runner does not have any associated shortcut keys. I want to be able to select certain tests and be able to run or debug them without resorting to grabbing the mouse each time. Is using the mouse my only option? 回答1: ReSharper adds items to Visual Studio's keyboard settings dialog box. Go to: Tools -> Options, Environment

Prevent Visual Studio from breaking on unhandled exceptions

三世轮回 提交于 2019-12-30 17:27:10
问题 I have a set of NUnit tests (running using the Resharper test runner), and some of those fail due to assertion exceptions happening in background threads; and when this happens VS2017 breaks into the debugger, what is undesirable as I want it to keep on running other tests. All the settings in "Exception Settings/CLR/Thrown" are turned off. The "User-Unhandled" settings in that dialog aren't present whether I switch the "Just My Code" option on or off All the "Exception Settings/Managed

How can you force StyleCop for ReSharper to ignore files?

醉酒当歌 提交于 2019-12-30 03:03:10
问题 We’ve just been working on introducing StyleCop to our team and are using the StyleCop ReSharper plugin from Code Plex. Problem is, every single file in the project appears to be getting analysed and we can’t find a way to exclude particular files. This includes files such as the designer.cs file from the DBML or third party components included in the project. What this means is your site wide code analysis in ReSharper always shows up errors and you can never get it to go “green”. There’s

Resharper 7.1 Solution Analysis False Errors

和自甴很熟 提交于 2019-12-30 02:47:17
问题 In our VS2012 web project we are getting hundreds of errors reported by Resharper, but the software builds and compiles fine. How do I get resharper to correctly identify the fact that the solution is actually fine. All the errors are about properties on classes are not found. I have tried cleaning the solution and forcing Resharper to re-analyze. 回答1: Resharper gets confused for many reasons, but some of the times I had issues the solutions I did were: like this case disable Resharper for a