如何在同一个程序引用不同版本DLL

在工作中,可能会遇到这种情况:由于某些组件是别人开发的,引用了某一个版本的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>
posted @ 2020-01-03 08:59  Jazz_Law  阅读(590)  评论(0编辑  收藏  举报
#RecentCommentsBlock li { margin: 0; width: 275px; } #RecentCommentsBlock li.recent_comment_body { border-radius: 0; margin: 0; } #RecentCommentsBlock li.recent_comment_title { border-radius: 5px 5px 0 0; margin: 3px 0 0; } #RecentCommentsBlock li.recent_comment_author { border-radius: 0 0 5px 5px; margin: 0; } .desc_img{ width:75px; max-width:75px; } #blog-calendar{ background:white; } /* comment */ div.commentform{ margin-bottom:100px; } #commentform_title { background: url("http://static.cnblogs.com/images/icon_addcomment.gif") no-repeat scroll 0 2px; color: #0078d8; font-size:14px; } div.commentform p{ margin-bottom:10px; } .comment_btn { height: 35px; width: 90px; background: none repeat scroll 0 0 #0078d8; border: 0 none; border-radius: 5px; color: white; cursor:pointer; } .comment_btn:hover{ background:#317ef3; } #commentbox_opt,#commentbox_opt + p { text-align:center; } #tbCommentBody{ width:100%; resize:none; } #tbCommentAuthor,#tbCommentBody{ border:1px solid #0078d8; } #tbCommentBody:hover{ border:1px solid #fca021; } #comments > h3 { background: none repeat scroll 0 0 #0078d8; border-radius: 3px; color: white; padding: 8px; border:0 none; font-size:14px; } #comments{ font-size: 13px; } #comments h4{ margin-top:10px; } #comments h4 span { color: #6c6351; font-size: 12px; } .comment_actions { border-bottom: 1px dashed #0078d8; display: block; padding-bottom: 10px; } .blog_comment_body { color: #111; font-size: 13px; margin-bottom: 10px; margin-top: 10px; } #comment_nav { font-size: 14px; margin-top: 10px; text-align: right; }