程序集引用异常 处理 app.config内控制runtime运行时应用的程序集版本指向 assemblyBinding结点 bindingRedirect

时间:2022-12-02 14:58:04

异常:

程序集引用异常 处理 app.config内控制runtime运行时应用的程序集版本指向  assemblyBinding结点 bindingRedirect

解决方法:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1"/>
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<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>
</configuration>