在工作中,可能会遇到这种情况:由于某些组件是别人开发的,引用了某一个版本的DLL,而另外一个组件引用另一个版本的相同DLL,在做二次开发的时候就需要把这两个DLL都添加进入程序当中
参考:https://blog.csdn.net/lj22377/article/details/84641087
以下是我在项目中使用的代码,在App.config中插入
<runtime maxRequestLength="2147483647" maxStringContentLength="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" executionTimeout="3600"> <legacyUnhandledExceptionPolicy enabled="true" /> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="System.Data.SQLite" publicKeyToken="db937bc2d44ff139" culture="neutral" /> <codeBase version="1.0.112.0" href="1.0.112.0\System.Data.SQLite.dll" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Data.SQLite" publicKeyToken="db937bc2d44ff139" culture="neutral" /> <codeBase version="1.0.94.0" href="1.0.109.0\System.Data.SQLite.dll" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="ICSharpCode.SharpZipLib" publicKeyToken="1b03e6acf1164f73" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-0.85.4.369" newVersion="0.85.4.369" /> </dependentAssembly> </assemblyBinding> </runtime> <system.serviceModel>
原文:https://www.cnblogs.com/arvinlaw/p/12143123.html