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

Razor视图引擎中,使用部分视图编译报错

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

 

查找网上一些解决方案,在微软官网找到同样问题

 

 最后解决方案:

 

在web.config文件system.web/compilation节点添加配置节点

 

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

 

posted @ 2018-11-02 15:17  负了韶华不负卿  阅读(9218)  评论(2编辑  收藏  举报