Newtonsoft.json程序包版本不匹配 [英] Newtonsoft.json assembly package version mismatch

查看:340
本文介绍了Newtonsoft.json程序包版本不匹配的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 SocketIO4Net 在.net中创建socket.io客户端.似乎SocketIO4Net具有Newtonsoft.Json> = 4.0.8的依赖项.我还使用了 PushSharp 库,该库的Newtonsoft.Json依赖性为> = 4.5.10.我第一次安装PushSharp时得到了NewtonSoft.Json 4.5.11,我认为这个版本也应该支持SocketIO4Net,因为它是一个更高的版本,但是无论何时尝试连接到socket.io服务器,我都会收到此错误.

I am trying to use SocketIO4Net to create socket.io client in .net. Itseems SocketIO4Net has a dependency of Newtonsoft.Json >= 4.0.8. I also am using PushSharp library which has a Newtonsoft.Json dependency of >= 4.5.10. I got NewtonSoft.Json 4.5.11 when i first installed PushSharp and I thought this version should support SocketIO4Net as well since its a higher version but i get this error whenever am trying to connect to socket.io server.

无法加载文件或程序集"Newtonsoft.Json,版本= 4.0.8.0,区域性=中立,PublicKeyToken = 30ad4fe6b2a6ed"或其依赖项之一.找到的程序集的清单定义与程序集引用不匹配. (来自HRESULT的异常:0x80131040)

Could not load file or assembly 'Newtonsoft.Json, Version=4.0.8.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

我整天都在为这些依赖问题而烦恼,如果有人能指出我正确的方向,我将不胜感激.

I have been banging my head all day with these dependency issues, I would be very grateful if someone can point me in the right direction.

推荐答案

找到解决方案,尝试:

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

这篇关于Newtonsoft.json程序包版本不匹配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆