resharper

Is there a way, at design time, to initialize an object with all properties in Visual Studio 2010?

。_饼干妹妹 提交于 2019-11-29 18:12:26
问题 Background I am writing code in VS 2010, .NET 4, C#. Also, in case it matters, I am using the latest version of ReSharper. Question Let's say I have this model: public class SomeObject { public string Red{ get; set; } public string Green{ get; set; } public string Blue{ get; set; } public string Yellow{ get; set; } public string Purple{ get; set; } public string Orange{ get; set; } public string Black{ get; set; } } Elsewhere in the code, I need to instantiate one of these objects, like so:

Access to disposed closure - mark methods as safe

你。 提交于 2019-11-29 17:02:50
问题 This is about ReSharper's warning "Access to disposed closure" which usually appears when an object which is later disposed is used in a lambda. Access to disposed closure in C#? discusses this in a bit more detail. My question is: For methods that take such lamdbas and execute them immediately (so you can be sure they are always executed before the said object is disposed): Is there a way to mark them as safe, so that any code using that method does no longer produced those warnings? Example

NUnit .NET Core running through Resharper

こ雲淡風輕ζ 提交于 2019-11-29 16:43:47
问题 I am trying to run NUnit tests for a .NET Core 2.0 project in Visual Studio 2017 through Resharper. I've had the test proj assembly set both as console app and class library. So it doesn't seem to be output type. The solution does not discover any unit test and just displays no results with 0 tests run. Here is my csproj for the tests project: <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <TargetFramework>netcoreapp2.0</TargetFramework> <AssemblyName>eCorp.WebStore.OrderService.Tests<

Spec fails when run by mspec.exe, but passes when run by TD.NET

一个人想着一个人 提交于 2019-11-29 16:33:57
I wrote about this topic in another question . However, I've since refactored my code to get rid of configuration access, thus allowing the specs to pass. Or so I thought. They run fine from within Visual Studio using TestDriven.Net. However, when I run them during rake using the mspec.exe tool, they still fail with a serialization exception. So I've created a completely self-contained example that does basically nothing except setup fake security credentials on the thread. This test passes just fine in TD.Net, but blows up in mspec.exe. Does anybody have any suggestions? Update: I've

Visual Studio 2010 extension for Go To Interface Implementation? [duplicate]

 ̄綄美尐妖づ 提交于 2019-11-29 16:20:49
问题 This question already has answers here : Closed 6 years ago . Possible Duplicate: How do you quickly find the implementation(s) of an interface’s method? I like ReSharper's Go To Implementation feature but I often keep ReSharper disabled. Is there an equivalent extension for Visual Studio 2010? 回答1: I'm looking for the extension for this little "go to implementation" too. But unfortunately I couldn't find any. May be we will have to wait next version of visual studio or enable ReSharper back

Resharper: Possible null assignment to entity marked with notnull attribute

自作多情 提交于 2019-11-29 15:57:41
问题 I get this warning on response.GetResponseStream() How should I handle this? // Get response using (var response = request.GetResponse() as HttpWebResponse) { // Get the response stream if (response != null) { var reader = new StreamReader(response.GetResponseStream()); var responseString = reader.ReadToEnd(); return responseString; } } For clarity based on some answers misinterpreting : This line is not where the warning is occurring: using (var response = request.GetResponse() as

How do I disable plugins from command line on visual studio?

自作多情 提交于 2019-11-29 14:17:47
Resharper is killing me for some reason on startup, I just need to get in, is there a command line switch for load without addins? You are probably looking for the /SafeMode command line switch : devenv.exe /SafeMode This will start Visual Studio with all add-ins disabled. 来源: https://stackoverflow.com/questions/885636/how-do-i-disable-plugins-from-command-line-on-visual-studio

How to disable /* autocomplete in Visual Studio 2012 (or Resharper)

♀尐吖头ヾ 提交于 2019-11-29 13:28:56
I have Visual Studio 2012 with Resharper installed. When editing css files, when I type /* , I get autocompletion like so: /**/ I would like to disable that , but I cannot find it in the options menu. Where can I disable that? Thank you! One way to avoid this annoyance is to add the closing comment symbols first. Go to tools -> options -> text editor -> all languages(or chose one), and untick Automatic brace completion . You can also search for it in options menu. 来源: https://stackoverflow.com/questions/12936215/how-to-disable-autocomplete-in-visual-studio-2012-or-resharper

Can I propagate XML documentation from an interface to its implementation?

非 Y 不嫁゛ 提交于 2019-11-29 13:12:44
I need to propagate XML documentation from a base class to derivative(s) or from an interface to implementation(s). Can I do this using Resharper? Jura Gorohovsky Yes you can. If you're yet to implement/override members, then in a derived class or interface implementation, click Alt + Ins , choose "Overriding members" or "Implement missing members". In the wizard that displays afterwards, choose members to implement/override, and make sure to select "Copy XML documentation". Alternatively, if you already have an overridden or implemented member in place, press Alt + Enter on the overridden

Invert “if” statement to reduce nesting

∥☆過路亽.° 提交于 2019-11-29 13:06:52
When I ran ReSharper on my code, for example: if (some condition) { Some code... } ReSharper gave me the above warning (Invert "if" statement to reduce nesting), and suggested the following correction: if (!some condition) return; Some code... I would like to understand why that's better. I always thought that using "return" in the middle of a method problematic, somewhat like "goto". jop A return in the middle of the method is not necessarily bad. It might be better to return immediately if it makes the intent of the code clearer. For example: double getPayAmount() { double result; if (