在一个解决方案中,如果外部DLL打包的第三方DLL与项目中引用的DLL有版本冲突,从而导致不能运行时。
解决方案
1: 先在项目中添加所需要的DLL,然后右键点属性,再查看该DLL的版本信息
2: 作类似的修改,将新版本号改为DLL的版本信息 <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>
3: 删除DLL引用,将该DLL COPY到BIN下面即可运行。