Ayomide Fajobi
Ayomide Fajobi

Reputation: 45

Compilation Error in my view

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" }))

Upvotes: 2

Views: 376

Answers (1)

Wendy E
Wendy E

Reputation: 99

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>

Upvotes: 3

Related Questions