GarethPN
GarethPN

Reputation: 482

Umbraco MVC build error - Collection.cshtml - 'System.Web.WebPages.Html.HtmlHelper' does not contain a definition for 'ViewData' or 'EditorFor'

I am getting a build error for an Umbraco MVC website:

'System.Web.WebPages.Html.HtmlHelper' does not contain a definition for 'ViewData' 'System.Web.WebPages.Html.HtmlHelper' does not contain a definition for 'EditorFor'

The error relates to a file in the packages folder:

....\packages\BeginCollectionItem.1.2.1.0\content\Views\Shared\EditorTemplates\Collection.cshtml

I can add the web.config file in the Views folder in there, which resolves this particular issue, but then starts complaining about a missing reference to 'Orchard', and I am concerned that I am just masking a deeper issue.

Has anyone come across this before? If so, how was it resolved?

Upvotes: 0

Views: 133

Answers (1)

GarethPN
GarethPN

Reputation: 482

The issue was in the csproj file. MvcBuildViews was set to true.

Upvotes: 1

Related Questions