2

I keep getting this error message in my view when I run my program, I really don't know what is wrong..

Error Message

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'.

@using (Html.BeginForm("Register", "MyAccount", FormMethod.Post, new { @class = "form-horizontal", role = "form" }))

1 Answer 1

3

Try this link http://www.lyalin.com/2014/04/25/the-type-system-object-is-defined-in-an-assembly-that-is-not-reference-mvc-pcl-issue/

It suggests changes to your config file to correct this error, including changing the existing section to look like this:

<compilation debug="true" targetFramework="4.5">
      <assemblies>     
        <add assembly="System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />   
      </assemblies>
</compilation>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.