解決未能負載檔案或程式集“Newtonsoft.Json ...."或它的某一個依賴項。找到的資訊清單定義與程式集引用不匹配。 (異常來自 HRESULT:0x80131040)

來源:互聯網
上載者:User

標籤:sse   程式   今天   成功   更新   lin   redirect   entity   類庫   

今天遇到了一個比較坑的問題,琢磨了好久。。。

因為需要引用一個第三方的類庫,三方的類庫引用的是Newtonsoft.Json.dll 版本7.0.0而我的項目中引用的是Newtonsoft.Json.dll 版本4.5.0,這樣兩個引用造成了衝突。所有的引用都OK,編譯時間提示“ Newtonsoft.Json.Linq”未引用,可是這明明已經引用了。嘗試使用nuget更新,更新到最新版9.0.0,更新成功後可以一成功編譯,但是訪問時又出現這個樣的問題。

最終解決方案,修改web.config,這裡只是告訴大家格式,只用添加完整的dependentAssembly內容即可。

<runtime>    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">      <dependentAssembly>        <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" culture="neutral" />        <bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" />      </dependentAssembly>      <dependentAssembly>        <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />        <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />      </dependentAssembly>    </assemblyBinding>  </runtime>

 

解決未能負載檔案或程式集“Newtonsoft.Json ...."或它的某一個依賴項。找到的資訊清單定義與程式集引用不匹配。 (異常來自 HRESULT:0x80131040)

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.