.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 ...
随机推荐
- 关于ASPXGridview的双击事件弹出 【转】
在网上找了好长时间,关于ASPXGridview的双击事件弹出ASPxPopupControl,也没有找到适合自己的代码,这里将自己编写出来的代码与大家分享一下 希望我的代码能够对你有所帮助. 直接上 ...
- Shell if 判断之detail
参考: http://blog.chinaunix.net/uid-20788517-id-3135826.html
- CDH5X 安装oozie报错To enable Oozie web console install the Ext JS library.
最近在CDH5.X 安装oozie 服务,服务安装完毕,访问oozie server ui,报如下错误: 页面提示: Oozie web console is disabled.To enable O ...
- 10道javascript笔试题
1.考察this JavaScript var length = 10; function fn() { console.log(this.length); } var obj = { length: ...
- MAC下如何显示隐藏文件
1.在终端上输入以下命令 defaults write com.apple.finder AppleShowAllFiles -bool true 2.重新启动Finder Command + Opt ...
- 创建 Transact-SQL 作业步骤
创建 Transact-SQL 作业步骤 在对象资源管理器中,连接到 SQL Server 数据库引擎实例,再展开该实例. 展开"SQL Server 代理",创建一个新作业或右键 ...
- 关于IIS服务器证书续订
输入办证机构+服务器名或IP 办证机构可以通过certsrv.msc来查看 输入完后点完成
- nodevalue
在改变文本节点值时,使用DOM的nodeValue属性,用来得到和设置一个节点的值. 代码示例: html: <p id="description">choose a ...
- FreeMarker操作符
操作字符串函数 1. substring(start,end)从一个字符串中截取子串 start:截取子串开始的索引,start必须大于等于0,小于等于end end: 截取子串的长度,end必须大于 ...
- (原创)VM中的CentOS6.4中安装CloudStack6.3①
CloudStack是一个功能强大.UI友好的开源云(IaaS)计算解决方案.自Ctrix将CloudStack捐献给 apache 后,一直持续高速发展,其社区活跃度已经渐渐赶上风头一时无两的另一开 ...