加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

asp.net – 使用MvcBuildViews构建Razor = true失败

发布时间:2020-12-16 07:45:15 所属栏目:asp.Net 来源:网络整理
导读:我有一个使用MvcContrib和MvcScaffold构建的新项目.动态编译一切正常.但是,当我在项目文件中打开视图编译时,编译会中断. The name 'model' does not exist in the current context'System.Web.WebPages.Html.HtmlHelper' does not contain a definition for
我有一个使用MvcContrib和MvcScaffold构建的新项目.动态编译一切正常.但是,当我在项目文件中打开视图编译时,编译会中断.

The name 'model' does not exist in the current context
'System.Web.WebPages.Html.HtmlHelper' does not contain a definition for 'LabelFor' and no extension method 'LabelFor' accepting a first argument of type 'System.Web.WebPages.Html.HtmlHelper' could be found (are you missing a using directive or an assembly reference?)
'System.Web.WebPages.Html.HtmlHelper' does not contain a definition for 'EditorFor' and no extension method 'EditorFor' accepting a first argument of type 'System.Web.WebPages.Html.HtmlHelper' could be found (are you missing a using directive or an assembly reference?)
'System.Web.WebPages.Html.HtmlHelper' does not contain a definition for 'ValidationMessageFor' and no extension method 'ValidationMessageFor' accepting a first argument of type 'System.Web.WebPages.Html.HtmlHelper' could be found (are you missing a using directive or an assembly reference?)

如果你是left out the web.config file from the Views folder,那就是你会收到同样的错误,但那就是现在.我已经有了Phil Haack’s fix,但无济于事.为什么MSBuild没有找到MVC3好东西?

解决方法

我发现我在配置文件中意外复制了system.web部分,导致了同样的错误.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读