Newtonsoft.json assembly package version mismatch(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, Version=4.0.8.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed"或其依赖项之一.找到的程序集的清单定义与程序集引用不匹配.(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 程序集包版本不匹配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Newtonsoft.json 程序集包版本不匹配


- 使用 rss + c# 2022-01-01
- 带问号的 nvarchar 列结果 2022-01-01
- 在 LINQ to SQL 中使用 contains() 2022-01-01
- Windows 喜欢在 LINUX 中使用 MONO 进行服务开发? 2022-01-01
- C# 通过连接字符串检索正确的 DbConnection 对象 2022-01-01
- Azure Active Directory 与 MVC,客户端和资源标识同一 2022-01-01
- CanBeNull和ReSharper-将其用于异步任务? 2022-01-01
- 为什么 C# 中的堆栈大小正好是 1 MB? 2022-01-01
- 是否可以在 .Net 3.5 中进行通用控件? 2022-01-01
- 在 C# 中异步处理项目队列 2022-01-01