2

我有一个正在调整的 MVC4 Web 应用程序。当前加载一个控制器Index.cshtml。在该文件中,我有以下行:

@{
    Layout = "~/Views/Shared/_Layout-DoubleColumn.cshtml";
}

所以我将该行更改为:

@{
    Layout = "~/Views/Shared/_Layout-TripleColumn.cshtml";
}

我还复制到_Layout-DoubleColumn.cshtml文件并将其重命名为_Layout-TripleColumn.cshtml.

现在,当我运行应用程序时,我收到以下错误消息:

在以下路径中找不到布局页面“~/Views/Shared/_Layout-TripleColumn.cshtml”:“~/Views/Shared/_Layout-TripleColumn.cshtml”

我不知道问题可能是什么,因为我确定文件在Shared文件夹中......

在此处输入图像描述

有人知道问题可能是什么吗?

4

1 回答 1

3

确保文件的 Build Action 在 View 的属性中设置为 Content。

于 2013-06-25T08:49:30.107 回答