Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/290.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 发布时出现MVC 5文件夹结构问题_C#_Asp.net Mvc_Razor - Fatal编程技术网

C# 发布时出现MVC 5文件夹结构问题

C# 发布时出现MVC 5文件夹结构问题,c#,asp.net-mvc,razor,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当

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

我在视图页面上以部分视图的形式呈现此视图,如下所示:

@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

您的视图必须具有
内容
生成操作,否则它们不会包含在发布中。检查视图的属性:


试试这个
@Html.Partial(“Scripts/Case\u Action\u Comments.cshtml”)
和其他方法also@AmitAgrawal那会怎么样?视图引擎显然试图查找
.cshtml
文件。@Stijn:有时它会在视图或局部视图或两者之间产生问题?@stibay both。视图未定义为“完整”或“部分”,单个视图可以同时渲染为两个视图。