解决Newtonsoft.Json版本冲突问题
在配置文件中添加以下代码,App.config或Web.config
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-10.0.0.0" newVersion="10.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
oldVersion从什么版本到什么版本都强制使用newVersion的版本。
本例子说明从0版本到10版本,都强制使用10版本。
放上Newtonsoft.Json的版本下载地址:https://github.com/JamesNK/Newtonsoft.Json/releases
下载之后里面包括了.NET各版本的DLL文件,选择合适你工程的版本就行了。

浙公网安备 33010602011771号