繁体   English   中英

Elmah MySql Nuget包问题'无法加载文件或程序集'

[英]Elmah MySql Nuget Package Issue 'Could not load file or assembly'

我正在尝试将Elmah添加到我的MVC3项目中。 通过Nuget安装后,当我尝试访问elmah(通过localhost:port/elmah.axd )时,出现包含此错误的错误:

Could not load file or assembly 'MySql.Data, Version=6.1.3.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' or one of its dependencies. The system cannot find the file specified.

我删除了mysql.data dll并添加了我自己的副本(版本6.4.4.0 - 文档说你可以覆盖新版本提供的dll),但是这个错误仍然存​​在。 有人遇到过这种情况么?

我的解决方案是将其添加到我的web.config:

<configuration>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity 
          name="MySql.Data" 
          publicKeyToken="c5687fc88969c44d" 
          culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-6.4.4.0" newVersion="6.4.4.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>

这基本上告诉编译器,只要有什么东西请求版本0.0.0.0和6.4.4.0之间的MySql.Data程序集的版本,它应该改为提供版本6.4.4.0程序集。

暂无
暂无

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

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