resharper

How to get Resharper to convert back to a foreach loop

Resharper 5 can convert my foreachloops to Linq queries. Which I like. But linq is way way way harder to debug than a foreachloop. When I convert my foreach statement to a linq query, I don't see any option to go back the other way. Does any one know how to do this? Is it even possible? ...

Is there a way to make VS/R#/whatever enforce CLR/CTS types instead of C# ones?

It has nothing to do with the question per se, but I guess I'd rather state my reason for wanting to. I'm not developing an API to be consumed by a lot of other .NET languages or anything like that, but it's rather a matter of style and readability. I don't like how the C# aliases are 1. colored in VS like reserved words instead of typ...

C# + Reshaper - Events method with underscore - Naming convention

I have VS 2010 with resharper (any version, now 5.1). The default naming convention coming with R# about public or protected method's name is: "ThisIsMethodName", and I think it's fine. But, sometimes, the default naming of .NET methods, is not like I'm expecting, for example Page_Load, or (with a button click in webform designer panel)...

ASP.Net MVC Keeping parameter names and action argument names in sync.

I've noticed a pattern that can make refactoring MVC2 apps difficult. When you change the name of an argument for an action you must update the values everywhere that action is used. For example, public ActionResult List(string p) in the view <%= Html.ActionLink("List", "Directory", new { p = "somePath" }, null) %> What if I want t...

Is there a resharper comment directive to disable code cleanup for a class?

I have a class where FileHelpers is dependent on the field order in this class file. If the class file ever gets a code clean up run against it that will cause the fields to be sorted alphabetically and invisibly ruin my class. Since I would like to avoid this from ever accidentally occuring, is there a resharper comment directive to di...

MbUnit and Resharper integration not working in Visual Studio 2010

I set up a new machine this week. It is running Windows 7, 64 bit. I installed Visual Studio 2010 Professional, then Resharper 5.0, rapidly followed by Resharper 5.1 when it came out soon after. Since I have a project with tests in MbUnit, I have installed MbUnit/Gallio, using the 3.1.397 version x64 msi installer from here. I was expe...

ReSharper (or something like it) for Qt?

I am beginner of Qt Creator. I'm using resharper for visual studio 2005-2008 and it is very very good. Is there any tool like resharper for Qt? ...

How does ReSharper know this return type is never null?

I'm using ReSharper 5.0, and am wondering how its code analysis function knows to higlight the following assemblies == null with the comment "Expression is always false". var directory = new DirectoryInfo("somedir"); FileInfo[] assemblies = directory.GetFiles("*.dll"); if (assemblies == null <<--- this is highlighted with "Expression i...

Batch refactor "using" statement declarations in C# across multiple files

I have a bunch of c# code I inherited that has "using" statement declarations like this using Foo; using NS1=Bar.x.y.z; and I've been asked to make our codebase consistent with regard to namespacing - the policy is simply that 1 some namespaces should always be fully qualified (no aliases) - for example things inside "Foo" above sh...

Is this really a possible InvalidOperationException?

I have a Linq2Sql query that looks like this: var data = from d in dc.GAMEs where (d.GAMEDATE + d.GAMETIME.Value.TimeOfDay) >= DateTime.Now && d.GAMESTAT == 'O' && d.GAMETYPE == 0 select d; Resharper is underlining the "d.GAMETIME.Value.TimeOfDay" in blue and telling me it's a possible System.InvalidOperationException. Wh...

Resharper 5 plugin creation

I'm looking to create a plugin for resharper 5. I looked through their site and didn't find any information about where to begin. So, where do I begin? ...

Formatting Resharper backing fields for properties in C#

So this is a follow-up to Keith Nicholas' question from 2 years ago: Formatting Resharper backing fields for properties in C# My guess is this would probably involve a custom Type Members Layout. Is there a way to to this yet in the latest Resharper version (as of now, it's 5.1) yet? ...

outlaw string in c# using intellesence

Hi, I often type string in c# when actually I want to type String. I know that string is an alias of String and I am really just being pedantic but i wish to outlaw string to force me to write String. Can this be done in ether visual studio intellesence or in resharper and how? ...

How to stop ReSharper removing spaces in object initializer

I like my object initializers to look like this: new Point { Label = g.Key.Name, Claims = g }; When hit the semicolon key, they get reformatted like this: new Point {Label = g.Key.Name, Claims = g}; Where is the option to stop my padding from being removed? ...

Why does Resharper rename variables to start with an underscore?

I've never understood this, and frankly, it pisses me off to see it in code: variable names that begin with an underscore. What is the point of this? I've just installed Resharper 5.1, trying it out and it seems nice, though this one thing is ruining it for me. I haven't checked, but I'm hoping I can turn it off. But why is it done in...

Resharper warns about using a virtual function in a constructor, but unlike C++ it is not an error

Possible Duplicate: Virtual member call in a constructor First of all, why isn't it an error to call a virtual function inside a ctor in C#? Second of all, if it is allowed, why does Resharper still warn about it? ...

How do I disable (or change) keyword highlighting in comments?

I am using Visual Studio 2008, and Resharper 5.0: There are certain keywords such as note, bug, and todo that are highlighted within comments that I would like to disable or at least alter the highlight color and/or specify keywords. However I can't find any settings in Visual Studio's Fonts and Colors options nor in Resharper's option...

Resharper API... Uh... where is it?

Ok I must be having a blonde moment, but for the life of me I can't find where to download the resherper API, to use with the project I got from Here: http://devlicio.us/blogs/hadi_hariri/archive/2010/01/12/writing-plug-ins-for-resharper-part-1-of-undefined.aspx Any help or links would be greatly appreciated. Cal- ...

What is the difference between a regular string and a verbatim string?

I have a trial version and Resharper and it always suggest that I switch regular strings to verbatim strings. What is the difference? ...

How can I sync my Resharper settings between computers?

I have a work PC and a laptop at home that I dev on using Resharper. Unfortunately, every time I add a live template or change my formatting settings, I have to export and import the settings/templates between computers. For visual studios settings, I use the Automatically save my settings to this file option in conjunction with a file...