无法修改mvc中的cshtml页面

Unable to modify cshtml page in mvc

有一个mvc应用程序,我试图在其中修改预编译的CSHTML页面(Index.cshtml)

@using System.Web.Mvc.Html
@model Services.Admin.ViewModels.IndexViewModel
@{
Layout = "~/Views/Admin/_Layout.cshtml";
ViewBag.Title = Resources.AdminResources.Index_Title;
}
<div class="container">
<div class="masonry">
    <div class="item col-lg-4 col-md-4 col-sm-4">
        <h3>Event Clinics</h3>
        <table class="table table-striped table-bordered table-hover">
            <tbody>
            <tr>
                <td class="max-width">
                    @Html.ActionLink("Premier Instructors", "Index", "PremierInstructor")
                </td>
                <td></td>
            </tr>
            <tr>
                <td class="max-width">
                    @Html.ActionLink("Reports", "Index", "Reports")
                </td>
                <td></td>
            </tr>
            <tr>
                <td class="max-width">
                    @Html.ActionLink("Users", "Index", "Users")
                </td>
                <td></td>
            </tr>
            </tbody>
        </table>
    </div>   
</div>

这里还有相应的Index.generated.cs,其中所有代码都是在"WriteLiteral"的帮助下编写的。

当我尝试 add/modify .cshtml 格式时,它的影响没有显示在 UI 上。

我也在各种网站上找到,发现这些 cshtml 已经使用 "RazorGenerator" 工具编译。

现在我的问题是,当我要对此类 cshtml 文件进行任何更改时,它不会反映在屏幕上。

对于基于 RazorGenerator 的 pre-compiled .cshtml 表单,因为需要修改它 html 然后按照以下步骤操作。

  1. 右键单击 .chstml 文件(例如 index.cshtml)。
  2. 单击 "Properties"。
  3. 在 "Advanced" 部分下,从 "Custom Tool" 选项中删除 "RazorGenerator"。
  4. 在 CSHTML 文件中进行更改。
  5. 再次执行上述 1,2 步骤。
  6. 在 "Advanced" 部分下,在 "Custom Tool" 选项中添加 "RazorGenerator"。
  7. 保存表格并运行它。

现在您将看到 UI 中的所有更改。