2012-04-11 54 views
5

我有一个使用MvcContrib和MvcScaffold构建的新项目。一切工作正常动态编译。但是,当我在项目文件中启用视图编译时,编译会中断。用MvcBuildViews构建剃须刀= true失败

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的好东西?

+0

可能会有点晚,但你看到http://stackoverflow.com/q/4725387/195550? – 2013-05-02 20:02:16

回答

1

我发现我不小心重复了导致相同错误的配置文件中的system.web部分。