2016-12-10 111 views
1

我在DotNetNuke中有一箇舊模塊。我在我的項目中使用EF 5:無法在DotNetNuke中加載文件或程序集EntityFramework

EF

我添加模塊,DotNetNuke的,它的工作正常。但是,當我再補充一點requierd EF英孚新模塊6我的模塊給我一個錯誤:

Could not load file or assembly 'EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference.

在安裝這個新的模塊的EntityFramework 6 DLL文件將與老版本替換(版本5.0.0.0 =)文件,該導致舊模塊不工作。

我看了很多文章解決這個問題,但我找不到解決這個問題的方法。

如果有人能夠解釋這個問題的解決方案,這將是非常有益的。

回答

1

您可以將它添加到你的web.config

<configuration> 
    <runtime> 
    <dependentAssembly> 
     <assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089" culture="neutral" /> 
     <codeBase version="6.0.0.0" href="bin/EntityFramework-6.1.3/EntityFramework.dll" /> 
    </dependentAssembly> 
    <dependentAssembly> 
     <assemblyIdentity name="EntityFramework.SqlServer" publicKeyToken="b77a5c561934e089" culture="neutral" /> 
     <codeBase version="6.0.0.0" href="bin/EntityFramework-6.1.3/EntityFramework.SqlServer.dll" /> 
    </dependentAssembly> 
    </runtime> 
</configuration> 

你必須添加一個名爲的EntityFramework-6.1.3進入bin文件夾中的文件夾然後添加兩個後續dll即可 1-EntityFramework.dll 2-EntityFramework.SqlServer.dll

0

您可以添加這web.config中

<configuration> 
    <runtime> 
     <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> 
      <dependentAssembly> 
       <assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089" culture="neutral" /> 
        <bindingRedirect oldVersion="0.0.0.0-6.1.3.0" newVersion="6.1.3.0" /> 
      </dependentAssembly> 
     </assemblyBinding> 
    </runtime> 
</configuration> 
相關問題