惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

C
CXSECURITY Database RSS Feed - CXSecurity.com
Help Net Security
Help Net Security
P
Privacy International News Feed
S
Securelist
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
T
Tor Project blog
AWS News Blog
AWS News Blog
K
Kaspersky official blog
A
Arctic Wolf
Latest news
Latest news
T
Threat Research - Cisco Blogs
L
LINUX DO - 最新话题
P
Privacy & Cybersecurity Law Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
Google DeepMind News
Google DeepMind News
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
月光博客
月光博客
N
News and Events Feed by Topic
Jina AI
Jina AI
博客园 - 司徒正美
WordPress大学
WordPress大学
罗磊的独立博客
雷峰网
雷峰网
AI
AI
Hugging Face - Blog
Hugging Face - Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
S
Security @ Cisco Blogs
博客园 - 三生石上(FineUI控件)
H
Heimdal Security Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
酷 壳 – CoolShell
酷 壳 – CoolShell
C
Cisco Blogs
博客园 - 【当耐特】
The Hacker News
The Hacker News
有赞技术团队
有赞技术团队
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Schneier on Security
Schneier on Security
博客园 - Franky
S
SegmentFault 最新的问题
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Cloudbric
Cloudbric
爱范儿
爱范儿
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
S
Secure Thoughts
Last Week in AI
Last Week in AI
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Know Your Adversary
Know Your Adversary
Google DeepMind News
Google DeepMind News

博客园 - 风清云淡

Extjs使用 RestfulWebApi +Token验证小结 Oracle 10g的备份与还原 如何通过反射动态调用泛型方法 Oracle与Sql Server写SQL的区别 Oracle 表与字段的注释操作 将MS SQL SERVER 数据库导入到ORACLE的坑 SQL SERVER 触发器的误区 Asp.net Core部署于CentOS上报404错误的坑 SqlBulkCopy 来自数据源的 String 类型的给定值不能转换为指定目标列的类型 bit SQL SERVER OVER开窗函数,Partition By,ROW_NUMBER(),DENSE_RANK(),RANK()排名函数 CefSharp"Could not load file or assembly 'CefSharp.Core.dll' or one of its dependencies" Visual Studio中Js使用智能感知 Func<T>,Action<T>,Predicate<T>使用小结 Nuget 在VS中操作命令 Unity的动态加载简单使用 枚举的使用总结 IIS WEB程序如何访问共享目录 AngularJS之页面跳转Route ASP.NET MVC4 BundleConfig的注意事项
在同一个项中引用同一类库的多个版本
风清云淡 · 2017-02-16 · via 博客园 - 风清云淡

如何在同一个项中引用同一类库的多个版本?

在同一项目,有时会遇到要同时引一个类库多个版本的需求,例如大部分功能都是基于A 类库的1.0版本实现,现在有个特别的功能只在A类库的2.0版本才有,最好的办法是基于A库2.0版本再全部重写一下
但实际情况却是,所有功能已经很稳定了,不可能为了增加一个小功能而要全部重写,这时候就有必要同时引用A库的两个版本了,1.0和2.0版本

做法:
假设A库的文件为A.dll
1.将A库1.0文件命名为A1.dll
2.将A库2.0文件命名为A2.dll
3.在项目中同时引用A1.dll,A2.dll
4.在App.Config或Web.Config中加入以下节点,注意不同的版本指向不同的文件

<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="A" publicKeyToken="450cec67a1cde3d4" culture="neutral" />
<codeBase version="1.0" href="A1.dll" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="A" publicKeyToken="450cec67a1cde3d9" culture="neutral" />
<codeBase version="2.0" href="A2.dll" />
</dependentAssembly>
</assemblyBinding>
</runtime>