【问题标题】:Compilation Error in my view在我看来编译错误
【发布时间】:2015-07-10 00:40:15
【问题描述】:

当我运行我的程序时,我的视图中不断收到此错误消息,我真的不知道出了什么问题..

错误信息

CS0012:“System.Object”类型是在未引用的程序集中定义的。您必须添加对程序集“System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a”的引用。

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

【问题讨论】:

    标签: razor html.beginform


    【解决方案1】:

    试试这个链接 http://www.lyalin.com/2014/04/25/the-type-system-object-is-defined-in-an-assembly-that-is-not-reference-mvc-pcl-issue/

    它建议更改您的配置文件以纠正此错误,包括将现有部分更改为如下所示:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-05-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多