resharper

DisconnectedContext error when running Unit Tests in debug in VS2015

北战南征 提交于 2019-12-02 22:06:53
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 the same code in debug on his machine without any issues. Just running the test (without debugger)

VS2017内存占用高

匿名 (未验证) 提交于 2019-12-02 22:06:11
说明:本篇所提到的方法在我的机器上经过设置是能明显改善卡顿的,但可能你的VS卡顿的原因不一定是本文所提到的,可以通过排除法找到问题所在。 我的环境和硬件参数: vs 2017 pro版本 win10 x64 pro版本 CPU:i5-6500 3.2GHZ ,没有SSD,显卡 1050Ti ,16G DDR4内存 如果机器上没有独立显卡,是集显,取消以下 禁用- 基于客户端性能自动调整视觉体验,及子两项: 禁用-启用丰富的客户端视觉体验 禁用-如果可用xxx (查看是否有显卡:右击“计算机”――“管理”――“设备管理器”――“显示适配器” ,或输入命令行:dxdiag) 禁用 诊断工具 工具 - >选项 - >调试 - >调试时启用诊断工具) 如果出现:当前不会命中断点,找不到相应的位置 解决办法:在调试 - 实时 - 勾选脚本 点击 确定。 工具 - 选项 - 文本编辑器 - 所有语言 - CodeLens - 取消勾选 启用CodeLens (但是要勾选 显示引用 ,这样在代码的方法上方才会显示方法被引用X次) 工具 - 选项 - 源代码管理 - 插件选举 - 当前源代码管理插件 选择 无。 如果安装了Resharper的话,请参考关于Resharper的设置 提升ReSharper和Visual Studio的性能 ReSharper导致Visual Studio缓慢?

Possible multiple enumeration of IEnumerable? [duplicate]

為{幸葍}努か 提交于 2019-12-02 22:03:27
This question already has an answer here: Handling warning for possible multiple enumeration of IEnumerable 7 answers why is that ? how can I fix it ? 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() will just confirm there is at least one element and is a required check for you. Also you are not accessing any remote/external

ReSharper TypeScript seems to be not working at all in my VS 2015 installation

风格不统一 提交于 2019-12-02 21:57:15
ReSharper TypeScript seems to be not working at all in my VS 2015 installation. Despite of the correctly placed TypeScript definitions ReSharper does not recognize the defined types, gives zillion red underlines, and of course intellisense does not work on the variables. The error message is for example: Could not find symbol 'JQuery' Some more diagnostics: Compiling the project in VS 2015 compiles with no error. Making an intentional error in the source then build generates one correct error message Intentionally making a spell in the type definition file paths, it underlined with red

ReSharper Line Breaks and Wrapping

别来无恙 提交于 2019-12-02 21:44:22
So, this: cmd = new OdbcCommand( string.Format( @" SELECT * FROM Bobby_Tables WHERE Name = {0}", "Little Bobby Drop Tables" ), odbcConnection ); gets formatted to: cmd = new OdbcCommand( string.Format( @" SELECT * FROM Bobby_Tables WHERE Name = {0}", "Little Bobby Drop Tables" ), odbcConnection ); I've looked at each of the options for line breaks and wrapping but I haven't been able to find the one to keep things on the same line as long as possible. I'm assuming that I missed the correct option. My Right margin (columns) option is set to 100, which is plenty big. Question: Is there a way to

Using WPF components in NUnit tests - how to use STA?

心已入冬 提交于 2019-12-02 21:40:17
I need to use some WPF components in an NUnit unit test. I run the test through ReSharper, and it fails with the following error when using the WPF object: System.InvalidOperationException: The calling thread must be STA, because many UI components require this. I've read about this problem, and it sounds like the thread needs to be STA , but I haven't figured out how to do this yet. What triggers the problem is the following code: [Test] public void MyTest() { var textBox = new TextBox(); textBox.Text = "Some text"; // <-- This causes the exception. } Kent Boogaart Have you tried this ? ...

How to reorder type members with Resharper?

橙三吉。 提交于 2019-12-02 21:38:15
Typical scenario: a class that a lot of people have worked on. I'd like to sort methods, properties, etc... in alphabetical order. I'd like to be able to do this within the region or globally in the class. I see the feature in Resharper to do it, but it does not seem to do anything. Use the "Cleanup Code" functionality. The order of the members can be set up in the ReSharper options in Languages, C#, Type Members Layout. This is a well documented XML layout specification which ReSharper uses when reordering members. Sorting is not activated by default. You can activate it by opening the

Is it really worth purchasing R# for VS2010?

五迷三道 提交于 2019-12-02 20:49:37
I heard that R#5.0 (still in beta) will support VS 2010. My question is VS2010 == VS2008 + ReSharper ? I know there are many improvements to VS2010, so I 'm not sure weather is it really worth purchasing the R#5.0 for VS2010? Well, I haven't explored VS 2010 new refactoring features that much, but its my understanding that VS has some but definitely not all of resharpers features implemented (From MSDN ): Navigate To You can use the Navigate To feature to search for a symbol or file in the source code. Navigate To lets you find a specific location in the solution or explore elements in the

How to resolve incorrect “Ambiguous reference” from ReSharper on class inheritance?

有些话、适合烂在心里 提交于 2019-12-02 20:21:07
In my project I have a class that is inherited by many other classes. We'll call it ClassBase. public class ClassInheritFromBase : ClassBase When ClassBase is being inherited, ReSharper throws an "Ambiguous reference" warning on the ClassBase, and anything inside the new class that inherited from ClassBase does not have IntelliSense and gets warnings that it cannot find it. The project compiles and runs fine. If I change the namespace ClassBase is in and then change the inheriting classes, they find it fine and ReSharper has no problem, IntelliSense works ... until it is compiled. After the

Resharper multiline method invocation parenthesis alignment

倖福魔咒の 提交于 2019-12-02 20:19:53
Resharper is formatting multiline method calls like this: foo.Bar( x, y ); I would prefer it to align the closing parenthesis with the first line e.g.: foo.Bar( x, y ); I've looked through the Resharper code layout options, but cannot see the right setting. Can someone tell me how to achieve this alternative formatting? In Visual Studio, go to Resharper > Options > Languages > C# > Formatting Style > Other > Indentation > Continuous line indent multiplier and set it to 0. Can I recommend you take a look at StyleCop , and then StyleCop for ReSharper ? StyleCop allows you to create exceptions or