给出两个项目:
Project.Common
> Helpers
>> _PartialView.cshtml
Project.FirstProject
> Views
>> Shared
>>> (linked) _PartialView.cshtml
我在_PartialView.cshtml
上添加了一个对Project.FirstProject
到Project.Common
的链接引用:
但是,当我将文件复制到此位置时,什么有效不再适用于链接版本。
我收到经典的MVC“未找到视图”错误(为简便起见,我在这里将视图重命名):
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
为什么MVC找不到链接的局部视图?