Asp.net mvc 5 @发布后未看到应用程序_代码中的帮助程序

Asp.net mvc 5 @发布后未看到应用程序_代码中的帮助程序,asp.net-mvc-5,Asp.net Mvc 5,我有一个助手方法,希望在多个视图中共享,如下所示: @helper DoSomething() { <h1>Something</h1> } 我得到了想要的结果。当我尝试发布到Win2008R2服务器时,会收到以下错误消息: CS0103: The name 'PMHelpers' does not exist in the current context 在WebDeploy过程中是否需要进行一些特殊设置才能使其正常工作?我非常喜欢声明式帮助器,因为它们比

我有一个助手方法,希望在多个视图中共享,如下所示:

@helper DoSomething()
{
    <h1>Something</h1>
}
我得到了想要的结果。当我尝试发布到Win2008R2服务器时,会收到以下错误消息:

 CS0103: The name 'PMHelpers' does not exist in the current context
在WebDeploy过程中是否需要进行一些特殊设置才能使其正常工作?我非常喜欢声明式帮助器,因为它们比使用TagHelper类制作的帮助器更容易查看

谢谢,
John

事实证明,我的cshtml页面上的构建操作被设置为“无”,我将其设置为“内容”,效果非常好

 CS0103: The name 'PMHelpers' does not exist in the current context