我无法让我的 layout.cshtml 根据某些业务逻辑动态选择 CSS 文件。
在我的 layout.cshtml 中,我的头部有以下内容:
<head>
    <link href="@{Html.RenderAction("CustomStyleSheetPath", "Shared");}" rel="Stylesheet" type="text/css" />
</head>
在我的“共享”控制器中,我有:
[ChildActionOnly]
public virtual string CustomStyleSheetPath()
{
    string customCssPath = GetCssPath();  // e.g. "css/customStyleSheet.css"
    return customCssPath;
}
当我显示页面时,css 没有正确拉入,当我查看源代码时出现以下内容:
<head>
    <linkcss\customStyleSheet.css href="" rel="Stylesheet" type="text/css" />
</head>
这段代码曾经在 MVC 3 中工作,所以我想知道我做错了什么?