简体   繁体   English

Morelinq不适用于.net Framework 4.5.1

[英]Morelinq doesnt' work with .net framework 4.5.1

I am using morelinq in my asp.net mvc framework 4.5.1 project and it it is not loading proper system.runtime dll. 我在asp.net mvc框架4.5.1项目中使用morelinq,它没有加载正确的system.runtime dll。

 <package id="morelinq" version="3.0.0" targetFramework="net451" />
    <package id="System.ValueTuple" version="4.4.0" targetFramework="net451" />

it is throwing following error. 它引发以下错误。

The type 'System.Object' is defined in an assembly that is not referenced. 类型'System.Object'在未引用的程序集中定义。 You must add a reference to assembly 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. 您必须添加对程序集“ System.Runtime,版本= 4.0.0.0,区域性=中性,PublicKeyToken = b03f5f7f11d50a3a”的引用。 The type 'System.Attribute' is defined in an assembly that is not referenced. 类型“ System.Attribute”是在未引用的程序集中定义的。 You must add a reference to assembly 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. 您必须添加对程序集“ System.Runtime,版本= 4.0.0.0,区域性=中性,PublicKeyToken = b03f5f7f11d50a3a”的引用。

any clue? 有什么线索吗? I do not want to use old version of morelinq. 我不想使用morelinq的旧版本。

To implement the fix first expand out the existing web.config compilation section that looks like this (or similar) by default: 要实施此修复程序,请首先扩展现有的web.config编译部分,默认情况下,该部分类似于以下内容:

<compilation debug="true" targetFramework="4.5.1"/>

Then add the following: 然后添加以下内容:

<assemblies>     
    <add assembly="System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />   
</assemblies>

So, you should have something looking like this in your Web.Config file (among other things I imagine): 因此,您应该在Web.Config文件中有类似以下的内容(除我想象的以外):

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM