views:

246

answers:

3

I recently upgraded to using ReSharper 5 (currently in beta). I noticed that in ASP.Net MVC projects, ReSharper underlines in red all of the return statements inside a controller:

Annoying Red Underlines

I personally find this pretty annoying because it looks like an error. Clicking on the underlined text doesn't offer any help (ie, a lightbulb). I don't see an option to change the styling of this text in Environment -> Fonts and Colors, and so far it looks like the only way to disable it is to un-check the "Enable ASP.Net MVC References" in the ASP.Net -> Other Re-Sharper options.

What's the point of this highlighting? Am I missing out on something special that ReSharper is offering me? Is there a way to remove the highlighting while still enabling MVC support in ReSharper?

+5  A: 

Resharper smartly identifies the real view/controller/actionmethod your referencing by magic string. Do a Find Usagages and you'll see you can navigate to the view or controller.

Check this out ( scroll down a bit for the MVC features ): http://www.jetbrains.com/resharper/beta/beta.html#web_development

jfar
+2  A: 

It's not red - it's brown. It matches color of string literals in standard VS color scheme.

To change it's color, first, install latest nightly build of ReSharper 5.0.

Second, go in Tools→Options→Environment→Fonts & Colors, look for necessary items (ReSharper ASP.NET MVC Action & etc) and change it like you want.

If at second step you can't find ReSharper items, reset fonts&colors cache manually by deleting HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0\FontAndColors\Cache key in registry.

derigel
It's #a52a2a, which is definitely in the red shade of colors. It's just a lot less noticeable on a light background. Thanks for the tip on clearing the font and colors cache - that was the issue. I now see the ReSharper MVC settings and can modify them.
Lance McNearney
+1  A: 

The underline is used for two purposes:

  1. To indicate that the View/User control exists.
  2. You can navigate to it directly by clicking on it with the mouse button and hitting the Ctrl key (or F12 in VS Scheme Binding).

The idea here is to make you aware of missing views. It's only red (the text itself) when a View is missing and hitting Alt plus Enter, you'll get the Create from Usage possibility.

Hadi Hariri