.net解决程序集版本冲突的方法
以log4net为例,分为两种情况
1.不同version,相同publicKeyToken
在bin里放较新版本的dll
并在web|app.config的<configuration>下放
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="log4net" publicKeyToken="1b44e1d426115821" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.2.10.0"
newVersion="1.2.11.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
2.不同version,不同publicKeyToken
在bin里创建不同版本的文件夹,并放入对应版本的dll
并在
web.config的<configuration>下放
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="log4net" publicKeyToken="681549d62126b7b8" />
<codeBase version="1.2.9.0" href="bin/log4net1.2.9.0/log4net1.2.9.0.dll" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="log4net" publicKeyToken="1b44e1d426115821" />
<codeBase version="1.2.10.0" href="bin/log4net1.2.10.0/log4net1.2.10.0.dll" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="log4net" publicKeyToken="669e0ddf0bb1aa2a" />
<codeBase version="1.2.11.0" href="bin/log4net1.2.11.0/log4net1.2.11.0.dll" />
</dependentAssembly>
</assemblyBinding>
</runtime>
或者
app.config的<configuration>下放
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="log4net" publicKeyToken="681549d62126b7b8" />
<codeBase version="1.2.9.0" href="log4net1.2.9.0/log4net1.2.9.0.dll" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="log4net" publicKeyToken="1b44e1d426115821" />
<codeBase version="1.2.10.0" href="log4net1.2.10.0/log4net1.2.10.0.dll" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="log4net" publicKeyToken="669e0ddf0bb1aa2a" />
<codeBase version="1.2.11.0" href="log4net1.2.11.0/log4net1.2.11.0.dll" />
</dependentAssembly>
</assemblyBinding>
</runtime>
.net解决程序集版本冲突的方法的更多相关文章
- .Net dll多个同名的程序集版本冲突共存与通过基本代码或探测定位程序集方案
		.Net dll多个同名的程序集版本冲突共存与通过基本代码或探测定位程序集方案 在使用调用程序集的引用中的信息和配置文件中的信息确定了正确的程序集版本之后,并且在公共语言运行时在全局程序集缓存中进行检 ... 
- 解决jQuery版本冲突
		解决jquery版本冲突问题 <!-- 引入1.6.4版的jq --><script src="http://ajax.googleapis.com/ajax/libs/j ... 
- 解决jquery版本冲突问题
		解决jQuery1.3.2和1.4.2的冲突.(测试通过) 第一步:在1.4.2的源代码的最后加上一句 var $j4 = jQuery.noConflict(true);//之所以在源码这里加,而不 ... 
- 解决 SVN版本冲突
		链接:http://blog.csdn.net/windone0109/article/details/4857044 版本冲突原因: 假设A.B两个用户都在版本号为100的时候,更新了kingtun ... 
- 在Visual Studio 中使用 <AutoGenerateBindingRedirects> 来解决引用的程序集版本冲突问题
		问题: https://stackoverflow.com/questions/42836248/using-autogeneratebindingredirects-in-visual-studio ... 
- 解决Hash碰撞冲突的方法
		Hash碰撞冲突 我们知道,对象Hash的前提是实现equals()和hashCode()两个方法,那么HashCode()的作用就是保证对象返回唯一hash值,但当两个对象计算值一样时,这就发生了碰 ... 
- 如何解决jquery版本冲突
		<!-- 引入1.6.4版的jq --> <script src="<a href="http://ajax.googleapis.com/ajax/lib ... 
- 解决 .net core 中 nuget 包版本冲突问题
		今天在一个 asp.net core 项目中遇到了 nuget 包版本冲突的问题,错误信息如下: Version conflict detected for Microsoft.AspNet.WebA ... 
- 解决 .net core 中 nuget 包版本冲突问题[转载]
		今天在一个 asp.net core 项目中遇到了 nuget 包版本冲突的问题,错误信息如下: Version conflict detected for Microsoft.AspNet.WebA ... 
随机推荐
- 预装win8的系统换win7需要做的bios设置
			https://zhidao.baidu.com/question/873669708066476212.html (一)联想G50-70由于预装的是WIN8位系统,哪么改装WIN7 64位的方法如下 ... 
- H3C汇聚层交换机认证在线人数展示系统之CheckList和燃尽图(16/04/06-16/04/13)
			一.CheckList(核查表) 序号 事件 计划完成时间 实际完成时间 未延迟 未完成 完成 1 登录口令加密以及解密 16/04/06 16/04/06 Y 2 表的创建和IP以及口令 ... 
- Linux内核分析——分析system_call中断处理过程
			万子惠 + 原创作品转载请注明出处 + <Linux内核分析>MOOC课程http://mooc.study.163.com/course/USTC-1000029000 我选择的是get ... 
- 万圣节的糖果(Halloween Sweets)
			今天遇到codewars的一道题,这是链接,讲的是关于万圣节的一个题目,简单点说,就是9个包裹,一个天平,两次称的机会,怎么找出9个包裹中唯一一个较重的包裹. 像我这种年轻时候喜欢研究难题获得存在感的 ... 
- ubuntu 14.04安装右键打开终端功能
			命令行运行,安装完成后需重启: sudo apt-get install nautilus-open-terminal 
- 内存的crash记录分析
			服务器上线之后,发生了3次crash,感觉是一次比较典型的内存bug的排错经历,所以特地记录下来供以后借鉴.下面描述一下3次crash时候的coredump的当前堆栈信息. 第一次crash的core ... 
- iar 问题
			我的笔记本是win10 之前用的iar 430 版本是5.5 都没有问题.但,突然就 
- ionic slidebox  嵌套问题
			ionic slidebox 嵌套 会有一个 冒泡 事件 , 即使是 阻止了 父级冒泡也不管用 , 最终 用 滑动 事件on-drag="drag()" 去阻止 了父级的 滑 ... 
- C++开发ArcGis
			以下这段时间将主要记录如何使用C++开发ArcGis,包括1.C++的学习:2.GIS的基础知识:3.如何开发三部分,9-3后开始后将持续更新 
- LintCode Min Stack
			用两个stack, 第一个按顺序放所有值,第二个只放当前最小值. 注意: 1. 最小值有多个则都放到两个stack里, 尤其别忘放第二个: 2. pop时若两个stack的最上面值相等则都pop, 不 ... 
