ReSharper 6.0.2074.27 and ASP.NET MVC 3

I've been using ReSharper 6 for the past couple of weeks.  Today I installed 6.0.2074.27 and noticed that it started to provide feedback on ASP.NET MVC 3 Razor views.  This is great that work on this functionality is underway.  

I noticed a couple of things that I wanted to bring to JetBrains' attention.

  1. I'm using Url.Content to get the proper path to files in link, script, etc. tags.  In only the link tag I get an error reported if I use double quotes around the href attribute and around the content inside the Url.Content() method call.  For instance <link href="@Url.Content("some file")" generates an error saying a double quote is expected.  However, doing the same in a script tag does not.  <script src="@Url.Content("some file")" does not generate an error.
  2. Any place that I use C# in a cshtml file I'm getting an error if the proper using statement is not included. For instance, if I have a String.Empty in my cshtml I get an error, "Cannot resolve symbol String" until I include @System at the top of the file.  Razor does not require that the using statement be included.
  3. This one is kind of small and I may have to live with it.  I have a Layout page that includes a menu.  The cshtml files that will use this layout page all derive from a base controller with certain actions in it.  If I include a Url.Action("action in the base controller") in the Layout page I get an error saying "Cannot resolve action <action name>".  I get that you're not traversing the entire possible usage of the Layout page but it would be nice not to have to handle this error either.


Thanks,
Matt

3 comments

Hi Matt!

1. I'm using Url.Content to get the proper path to files in link, script, etc. tags.  In only the link tag I get an error reported if I use double quotes around the href attribute and around the content inside the Url.Content() method call.  For instance <link href="@Url.Content("some file")" generates an error saying a double quote is expected.  However, doing the same in a script tag does not.  <script src="@Url.Content("some file")" does not generate an error.


Should be fixed in next nightly build.

2. Any place that I use C# in a cshtml file I'm getting an error if the proper using statement is not included. For instance, if I have a String.Empty in my cshtml I get an error, "Cannot resolve symbol String" until I include @System at the top of the file.  Razor does not require that the using statement be included.


Please, monitor issue http://youtrack.jetbrains.net/issue/RSRP-202474.

3. This one is kind of small and I may have to live with it.  I have a Layout page that includes a menu.  The cshtml files that will use this layout page all derive from a base controller with certain actions in it.  If I include a Url.Action("action in the base controller") in the Layout page I get an error saying "Cannot resolve action <action name>".  I get that you're not traversing the entire possible usage of the Layout page but it would be nice not to have to handle this error either.


This is old known problem, not sure if it will be fixed in current release.

0

Answer 1 and 2 should be exchanged )
Namespaces are fixed, @Url is investigating.

0

Please sign in to leave a comment.