I have a new project built up using MvcContrib and MvcScaffold. Everything works fine with dynamic compilation. When I turn on view compilation in the project file, however, compilation breaks.
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?)
It's the same kind of errors you'd receive if you left out the web.config file from the Views folder, but that's present. I also have Phil Haack's fix in already, to no avail. Why isn't MSBuild finding the MVC3 goodies?
I found that I had accidentally duplicated the system.web section in my configuration file which caused the same error.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With