问题
Given two projects:
Project.Common
> Helpers
>> _PartialView.cshtml
Project.FirstProject
> Views
>> Shared
>>> (linked) _PartialView.cshtml
I have added a linked reference to _PartialView.cshtml
to Project.FirstProject
, linked from Project.Common
:
However, what works when I copy the file to this location no longer works with the linked version.
I get the classic MVC "View not found" error (I have renamed the view here in the name of brevity):
The partial view '_PartialView' was not found or no view engine supports the searched locations. The following locations were searched:
~/Views/Home/_PartialView.aspx
~/Views/Home/_PartialView.ascx
~/Views/Shared/_PartialView.aspx
~/Views/Shared/_PartialView.ascx
~/Views/Home/_PartialView.cshtml
~/Views/Home/_PartialView.vbhtml
~/Views/Shared/_PartialView.cshtml
~/Views/Shared/_PartialView.vbhtml
Why can't MVC find the linked partial view?
来源:https://stackoverflow.com/questions/54425335/linked-partial-view-not-found-by-mvc