Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Resharper cannot resolve partial view inside master page

I've upgraded from ReSharper 7 on vs2012 pro to ReSharper 8.1 on vs2013 pro, and ReSharper is now warning me a lot of my partial views cannot be resolved. It seems to be only happening:

  • In ASP master pages (i.e. not razor)
  • When the .ascx partial is in the same controller folder as the partial

E.g. Home.Master, located in ~/Views/Home/Home.Master renders UserProfile.ascx, located in ~/Views/Home/UserProfile.ascx. Both <%: Html.RenderPartial("UserProfile") %> and <%: Html.RenderPartial("~/Views/Home/UserProfile.ascx"%> are flagged by ReSharper as invalid.

Additionally, shared partials in the ~/views/shared folder seem to be picked up fine when I reference just by name:

RenderPartial by view name working correctly

However, referencing the view by path doesn't seem to work:

enter image description here

(NB. Both images are taken inside Home.Master, in ~/Views/Home)

When I run the application, the partials work correctly, so it seems to be a change in ReSharper 8.1. Is there anything I can do to fix this?

like image 365
berkeleybross Avatar asked Feb 04 '14 21:02

berkeleybross


1 Answers

It's a bug in ReSharper.

The best thing for now is to set it to ignore this type of error.

You can do this by selecting 'inspection options' from the 'red light bulb' on the left hand side and setting it to another option. Hopefully it will be fixed soon!

Edit: See this ticket for the problem. http://youtrack.jetbrains.com/issue/RSRP-395642

like image 68
BJury Avatar answered Sep 19 '22 15:09

BJury