【发布时间】:2012-04-11 17:44:09
【问题描述】:
我有一个使用 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 好东西?
【问题讨论】:
-
可能有点晚了,但你看到stackoverflow.com/q/4725387/195550了吗?
标签: asp.net asp.net-mvc-3 razor msbuild