@using (Html.BeginForm("Index", "Employees", FormMethod.Post, new { encType = "multipart/form-data", name = "EmployeeForm" }))
{
<table class="table table-bordered table-condensed table-striped">
<tr>
<th>
Name
</th>
<th>
Surname
</th>
<th>
ID Number
</th>
<th>
Email
</th>
<th>
Birthdate
</th>
<th>
Action
</th>
</tr>
@Html.EditorFor(model => model.Employees)
</table>
}
This line Line 32: @Html.EditorFor(model => model.Employees) gives the following Error
CS0012: The type 'System.Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
I have used this similiar approach in another project which did not give this error.
Look for this in your web.config:
<compilation debug="true" targetFramework="4.5"/>
Add the System.Runtime
assembly as follows:
<compilation debug="true" targetFramework="4.5">
<assemblies>
<add assembly="System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</assemblies>
</compilation>
This is usually caused due to MVC and PCL as detailed in the following article:
The type ‘System.Object’ is defined in an assembly that is not reference (MVC + PCL issue)
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