在使用百度UEditor,不小心將Newtonsoft.Json,升級了,然后就報的一個錯,說:
其他信息: 未能加載文件或程序集“Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed”或它的某一個依賴項。找到的程序集清單定義與程序集引用不匹配。 (異常來自 HRESULT:0x80131040),各種清理解決方案都不行
,后來在網站找到了一個方法 ,說插入以下代碼就可以了:
<runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" /> </dependentAssembly> </assemblyBinding> </runtime>
試了一下,成功解決問題,估計是重寫了默認配置的對Json.net的引用,不太懂,還需要學習: