resharper

How to reformat naming styles with ReSharper?

可紊 提交于 2019-12-17 20:45:03
问题 I have several pages of code that need to have naming styles reinforced, e.g. use fooBar instead of FooBar for local variables. I don't want to correct it one by one for an obvious reason. I tried to fiddle with the code cleanup profiles accessiable via ReSharper > Tools > Cleanup Code > Edit Profiles . I am not able to find a way to correct all naming style in one hit, or even with a keyboard shortcut. Could seasonsed ReSharper users advise how I can tackle this problem? 回答1: I don't believe

When would SqlCommand.ExecuteReader() return null?

穿精又带淫゛_ 提交于 2019-12-17 20:44:21
问题 When using calling the SqlCommand.ExecuteReader() method, ReSharper tells me I have a possible NullReference exception when I use the SqlDataReader object afterwards. So with the following code: using (SqlConnection connection = GetConnection()) { using (SqlCommand cmd = connection.CreateCommand()) { cmd.CommandText = ; //snip using (SqlDataReader reader = cmd.ExecuteReader()) { while (reader.Read()) { //snip } } } } The while (reader.Read()) line is underlined. My question is when would the

Visual Studio freezing (crashing) while loading solution

社会主义新天地 提交于 2019-12-17 18:57:15
问题 I've met with a strange problem. I had 7 projects in the solution. I had to add another MVC project. Now when the document (from the new project) is opened (for example HomeController.cs ) and when this project is initializing at the start, it freezes the whole IDE like this: (Some projects do not load) After that, I have to kill the process. When I open VS again and fast click on another project (which is initializing) the freezing issue is gone. I have no idea what can cause a problem like

Resharper suggests parameter can be of type 'BaseType'

让人想犯罪 __ 提交于 2019-12-17 18:39:13
问题 what are the benefits of using base types in method parameters? Here's one sample: private void Foo(List<int> numbers) //R# laments: parameter can be IEnumerable. { foreach (var i in numbers) { Console.WriteLine(i); } } And here's another one public class Foo : ICloneable { public object Clone() { return MemberwiseClone(); } public Foo CopyMe(Foo other) //R# laments: parameter can be ICloneable { return (Foo)other.Clone(); } } ...where we can change the type and anything but Foo will fail at

Why can't I reference my class library?

故事扮演 提交于 2019-12-17 17:59:29
问题 I have a solution that contains a website and a class library in Visual Studio 2008. I then have another web site project outside of the solution that needs to reference the class library. I right click the Bin folder or Project and select Add Reference, then select my Class Library Project, it adds the 15 or so DLLs that the class library needs to the websites bin folder, but none of the .cs files recognize the using statements. using MyLibrary.MyFolder; It says that it can't resolve it, and

How to make ReSharper re-evaluate its assembly reference highlighting

梦想与她 提交于 2019-12-17 14:59:31
问题 I am creating a Prism Project Template, and the template works great. But after I create a project with the template some of the files look like this: Despite appearances, everything is just fine. If I do a Rebuild All I see that the solution builds with no errors: But the rebuild all does not get rid of the "errors" that are showing in the editor window. (Note that the actual error window does not show any errors.) I can clean, rebuild, close and open files, and it will not fix the

Disable C# 6.0 Support in ReSharper

不打扰是莪最后的温柔 提交于 2019-12-17 10:32:23
问题 While using ReSharper, it suggested "Enable C# 6.0 support for this project". I foolishly clicked on it, and now as advertised it's giving me suggestions for C# 6.0 - which then give me errors as I am not using C# 6.0 in this project. How can I disable C# 6.0 support, returning it to how it was before? (Preferably without having to individually ignore specific suggestions) 回答1: Click the project node in the Solution Explorer. Then look in the Property Grid (F4). You'll see a property named "C

What are some alternatives to ReSharper? [closed]

蓝咒 提交于 2019-12-17 08:01:03
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . I'm considering purchasing a ReSharper license, but are there any possible alternatives to ReSharper and how would you rate these compared to ReSharper? It doesn't necessarily have to be a free alternative, but I would just like to know how good equivalent products are. 回答1: The main alternative is: CodeRush ,

Visual Studio displaying errors even if projects build

喜你入骨 提交于 2019-12-17 07:59:31
问题 I have a problem with Visual Studio on a C# solution. It displays totally random errors, but the projects build. Right now, I have 33 files with errors, and I can see red squiggly lines in all of them. I tried cleaning / rebuilding the solution, closing Visual Studio and even restarting my computer. I also made sure to do the steps described in Debugging runs even with compiler's errors in Visual Studio. I can modify .cs files and I see the changes in the solution. Does anyone have an idea

Does Resharper 6.1 work with MBUnit?

眉间皱痕 提交于 2019-12-14 04:25:17
问题 Unfortunately Resharper has a long history of breaking MBUnit support with every new release. I noticed version 6.1 has been released, but I can't use it until it works properly with MBUnit. So, does Resharper still work with MBUnit? I'd try it myself, but last time I did I lost all of my Resharper settings while downgrading, so I thought I'd better ask first this time. Thanks, Adrian 回答1: There's no official Gallio release supporting ReSharper 6.1 just yet. However, 6.1 support is a work in