发布时MVC 5文件夹结构问题

时间:2014-08-27 11:35:28

标签: c# asp.net-mvc razor

我在共享文件夹的子文件夹中有几个页面。

我在这样的视图页面上将这些视图呈现为部分视图:

@Html.Partial("Scripts/Case_Action")
@Html.Partial("Scripts/Case_Action_Comments")
@Html.Partial("Scripts/Case_History")

当我调试时,这种方法很完美,但是当我发布网站时,它再也找不到文件了。

当我调试URL时,如下所示:http://localhost:44300/Case/id当我发布URL时:http://xx.xxx.xx.xx/FOLDER/Case/id其中xxx *是IP。

那么我在调试和发布时如何才能完成这项工作?

这是错误:

The partial view 'Scripts/Case_Action' was not found or no view engine supports the searched locations. The following locations were searched:
~/Views/Case/Scripts/Case_Action.aspx
~/Views/Case/Scripts/Case_Action.ascx
~/Views/Shared/Scripts/Case_Action.aspx
~/Views/Shared/Scripts/Case_Action.ascx
~/Views/Case/Scripts/Case_Action.cshtml
~/Views/Case/Scripts/Case_Action.vbhtml
~/Views/Shared/Scripts/Case_Action.cshtml
~/Views/Shared/Scripts/Case_Action.vbhtml

1 个答案:

答案 0 :(得分:1)

您的观看次数必须包含Content构建操作,否则他们不会被包含在发布中。检查您的观看的属性:

screenshot of Visual Studio