I copied the MVC Futures Base templates into my project. This code will not run.
@using System.Data;
@functions{
bool ShouldShow(ModelMetadata metadata) {
return metadata.ShowForEdit
&& metadata.ModelType != typeof(System.Data.EntityState) <--This gives an error that entityState does not exist in namespace System.Data
&& !metadata.IsComplexType
&& !ViewData.TemplateInfo.Visited(metadata);
}
}
In the
<assemblies>section of your main~/web.config(not the one in~/views/web.config) file add the following line:This will ensure that the dynamically generated assemblies from the views will reference this assembly so that you can use types from it.