Linked Partial View Not Found By MVC

て烟熏妆下的殇ゞ 提交于 2019-12-13 18:57:16

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!