resharper

ReSharper and Rational Team Concert (RTC) - Do they play nicely together?

爱⌒轻易说出口 提交于 2019-12-10 21:13:34
问题 I have recently joined a small development team that is considering a new version control system. As it is part of a large organisation, we are likely to adopt the company standard of Rational Team Concert. I have recommended that they should choose something much simpler, but I will probably not get my way. I have a major concern that it will not play nicely with ReSharper, and will force me to change the way I work. I use ReSharper quite heavily to perform refactoring and have it create and

Auto generate properties when creating object

懵懂的女人 提交于 2019-12-10 21:08:35
问题 I have classes that have lots of properties, I was wondering that is there any way for Visual Studio, Resharper or other tool to create the syntax for calling the properties, when I create the object. So I dont have to go through all of properties the myself, just set the value and that's it. Something like this. Object foo = new Object{ prop1 = , prop2 = , prop3 = }; I don't know if people understood the question. I want Visual Studio to create the setter for the property when I create the

Should a local const variable start with Upper or lower casing

我与影子孤独终老i 提交于 2019-12-10 20:58:43
问题 Got a style conflict between StyleCop and Resharper. Stylecop 1303 says that const vars should start uppercase and I agree. Resharper says OK for class-wide const declarations, but when using a const in a local (e.g. method) scope, Reshaper doesn't approve and wants to make everything camelCasing. Of course no problem to disable this rule in R#, but what could be the reason behind this rule? Anyone any thoughts? 回答1: If you download Stylecop for Resharper then it comes with a Resharper

Resharper code cleanup not available on Unityconfig.cs

随声附和 提交于 2019-12-10 20:38:54
问题 I'm using ReSharper 2016.3.2 . It works nicely, but I bumped into a weird issue, the code cleanup feature is not available for UnityConfig.cs . The Refactor context menu is disabled, the hotkey for cleanup shows the following message: The Key combination (Ctrl+E, Ctrl+C) is bound to command (ReSharper_CleanupCode) which is not currently available. I looked into ReSharper settings, the Elements to skip blocks are empty, where they're present (Search & navigation, Code inspection settings). If

Code Contracts Ensures for ReSharper ExternalAnnotations

六月ゝ 毕业季﹏ 提交于 2019-12-10 19:01:43
问题 Does anyone know how to add Code Contracts Ensures in ReSharper ExternalAnnotations? It's not there in the last v7.1.3 nor in the latest v8 EAP, and neither in any of the custom xmls floating around. Specifically it should detect if a method does not return a null: Contract.Ensures(Contract.Result<T>() != null); 回答1: If you're attempting to simply appease the analysis engine, the simplest thing to use is [NotNull] in front of the method declaration. The Contract Annotations to which you

resharper unit test inheritance

别说谁变了你拦得住时间么 提交于 2019-12-10 18:48:06
问题 Has anyone got a strategy for unit testing heiarchies in Resharper? I typically use both TestDriven.Net and Resharper's test runner, with NUnit tests. TestDriven is awesome for everything but quickly finding a bad test out of a batch run (which could be thousands), which is where Resharper's runner comes in. I typically use a pattern with an abstract base class (like the code below) of test cases overridden to get the right subclass, which works great in TestDriven, but Resharper just ignores

Is this double instantation harmful, or simply unnecessary?

感情迁移 提交于 2019-12-10 18:33:35
问题 While perusing the legacy source, I found this: DataSet myUPC = new DataSet(); myUPC = dbconn.getDataSet(dynSQL); Resharper rightly "grays out" the "new Dataset()" part of it, and recommends, "Remove redundant initalizer," but is it as innocuous as that? Does the compiler simply dispose of the first instance just prior to the second assignment? IOW, is the first assignment simply unnecessary, or is it potentially harmful? 回答1: Does the compiler simply dispose of the first instance just prior

Where are logs located while running NUnit?

让人想犯罪 __ 提交于 2019-12-10 18:29:19
问题 I'm running NUnit tests from Resharper. I want to track execution process so my question is where can I find logs produced by my application? I use NLog, logger output path is relative, e.g. logs\mylog.txt . 回答1: I have a similar setup with my current project and for the unit tests, my NLog output goes to \UnitTests\bin\Debug\Logs. The logger is set up as follows in NLog.config (this produces a daily log file): <target name="FileLog" xsi:type="File" fileName="${basedir}/logs/${shortdate}_log

ReSharper 10 test runner failing to find AppSettings referenced from external file

大兔子大兔子 提交于 2019-12-10 18:23:01
问题 I recently upgraded to ReSharper 10.0.1 for Visual Studio 2013. My unit test project contains an app.config file which contains this: <appSettings file="AppSettings.local.config"> <add key="otherSetting" value="foo" /> </appSettings> <connectionStrings configSource="ConnectionStrings.local.config" /> The referenced config files are set to "Copy always" to the output directory. I verified that tests are running from \bin\debug off the project folder, and that both referenced config files are

Why is referenced dll getting locked while debugging under Resharper/MSTest?

a 夏天 提交于 2019-12-10 17:49:25
问题 I have an integration test for a method in assembly A . Assembly A references assembly B via project reference. I run them under the Visual Studio 2010 debugger in a Resharper 6.1 unit testing scenario. The testing engine is Microsoft's native MSTest. I get the infamous The process cannot access the file ...\B.dll because it is being used by another process. message. I have verified that no other process has a handle on that file (e.g. via Sysinternal's Process Explorer). Running the test out