.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 ...
随机推荐
- ibatis
ibatis学习笔记(一)>>>>>>>sqlMapConfig.xml文件详解 1.sqlMapConfig.xml配置文件详解: Xml代码 1. < ...
- DIV+CSS布局网站基本框架
html代码 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www. ...
- keyFile 巩固练习
系统 : Windows xp 程序 : noodles-crackme2 程序下载地址 :http://pan.baidu.com/s/1mhJ4Ems 要求 : 编写KeyFile 使用工具 : ...
- Ashx的处理实例(逻辑处理/js调用)
做asp.net开发的对.aspx,.ascx和.ashx都不会陌生.关于它们,网上有很多文章介绍.“纸上得来终觉浅,绝知此事要躬行”,下面自己总结一下做个笔记.1..aspxWeb窗体设计页面.We ...
- 第三章Git使用入门--读书笔记
“管理”一词,几乎在生活的方方面面都存在,而在Linux驱动开发中会涉及很多的源代码,对于数量繁多的源码,我们也应该有一个管理软件.Android和Linux内核及驱动开发的源代码基本都是由Git 来 ...
- 利用html5的画布canvas进行图片压缩处理
在网上找的代码,按自己的需求改了下,忘记在哪找的了.这里记着方便自己以后学习. // 参数,最大高度 //var MAX_HEIGHT = 100; var MAX_WIDTH = 200; // 渲 ...
- ASP.NET MVC中多种ActionResult用法总结
最近一段时间做了个ASP.NET MVC4.0的项目,项目马上就要结束了,今天忙里偷闲简单总结一下心得: 1. 如果Action需要有返回值的话,必须是ActionResult的话,可以返回一个Emp ...
- .net web端导出Excel个人的看法
//对已有方法进行重写 public override void VerifyRenderingInServerForm(Control control) { } //设置文件名 string fil ...
- the django travel(two)
一:django路由系统: 注意:我们在urls.py中 定义url的时候,可以加$和不加$,区别的是:加$正则匹配的时候,比如:'/index/$'只能匹配'/index/'这样的url 不能匹配' ...
- 部署点评Cat监控项目(转)
原文地址:http://www.bubuko.com/infodetail-986338.html 在项目中监控代码运行的状况,可以采用点评的Cat项目来监控整个项目,但是按照官方的文档来部署cat, ...