簡體   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