一.<assemblyBinding> 元素

包含有关程序集版本重定向和程序集位置的信息。

<assemblyBinding
xmlns="urn:schemas-microsoft-com:asm.v1" appliesTo="v1.0.3705">
</assemblyBinding>

特性和元素

下列各节描述了特性、子元素和父元素。

 

特性

说明

xmlns

必需的特性。

指定程序集绑定所需的 XML 命名空间。 使用字符串“urn:schemas-microsoft-com:asm.v1”作为值。

appliesTo

指定 .NET Framework 程序集重定向所应用的运行时版本。 此可选特性使用 .NET Framework 版本号指示其适用的版本。 如果没有指定 appliesTo的特性,<assemblyBinding> 元素将适用于 .NET Framework 的所有版本。 appliesTo特性是在 .NET Framework 1.1 版中引入的;.NET Framework 1.0 版将忽略该特性。 这意味着, 即使指定了appliesTo 特性,在使用 .NET Framework 1.0 版时所有的 <assemblyBinding> 元素也都适用。

子元素

元素

说明

<dependentAssembly>

封装程序集的绑定策略和程序集位置。 为每个程序集使用一个 <dependentAssembly>标记。

<probing>

指定加载程序集时公共语言运行时搜索的子目录。

<publisherPolicy>

指定运行时是否采用出版商策略。

<qualifyAssembly>

指定当使用程序集的部分名称时应动态加载的程序集全名。

父元素

元素

说明

configuration

每个配置文件中的根元素,常用语言 runtime 和 .NET Framework 应用程序会使用这些文件。

runtime

包含程序集绑定和垃圾回收的相关信息。

示例

1.下面的示例显示如何将一个程序集版本重定向到另一个版本并提供基本代码。

<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="myAssembly"
publicKeyToken="32ab4ba45e0a69a1"
culture="neutral" />
<bindingRedirect oldVersion="1.0.0.0"
newVersion="2.0.0.0"/>
<codeBase version="2.0.0.0"
href="http://www.litwareinc.com/myAssembly.dll"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

2.下面的示例显示如何使用 appliesTo 特性重定向 .NET Framework 程序集绑定。

<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1" appliesTo="v1.0.3705">
<dependentAssembly>
<assemblyIdentity name="mscorcfg" publicKeyToken="b03f5f7f11d50a3a" culture=""/>
<bindingRedirect oldVersion="0.0.0.0-65535.65535.65535.65535" newVersion="1.0.3300.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>

二.<dependentAssembly> 元素

封装每个程序集的绑定策略和程序集位置。 为每个程序集使用一个 dependentAssembly 元素。

<dependentAssembly> </dependentAssembly>

特性和元素

子元素

元素

说明

assemblyIdentity

包含关于该程序集的标识信息。 此元素必须包含在每个 dependentAssembly 元素中。

codeBase

如果计算机上未安装共享程序集,指定运行时可在何处找到共享程序集。

bindingRedirect

将一个程序集版本重定向到另一个版本。

publisherPolicy

指定运行时是否应用此程序集的出版商策略。

父元素

元素

说明

assemblyBinding

包含有关程序集版本重定向和程序集位置的信息。

configuration

每个配置文件中的根元素,常用语言 runtime 和 .NET Framework 应用程序会使用这些文件。

runtime

包含程序集绑定和垃圾回收的相关信息。

示例

<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="myAssembly"
publicKeyToken="32ab4ba45e0a69a1"
culture="neutral" />
<!--Redirection and codeBase policy for myAssembly.-->
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="mySecondAssembly"
publicKeyToken="32ab4ba45e0a69a1"
culture="neutral" />
<!--Redirection and codeBase policy for mySecondAssembly.-->
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

<runtime> 的 <assemblyBinding> 元素的更多相关文章

  1. <runtime> 的 <assemblyIdentity> 元素和<bindingRedirect> 元素

    1.<assemblyIdentity> 元素 包含关于该程序集的标识信息. <assemblyIdentity name="assembly name" pub ...

  2. C# 自定义exe引用的dll路径

    MSDN原文:https://msdn.microsoft.com/library/twy1dw1e(v=vs.100).aspx <runtime> 的 <assemblyBind ...

  3. probing元素

    https://msdn.microsoft.com/zh-cn/library/823z9h8w(v=vs.85).aspx 指定加载程序集时公共语言运行库要搜索的应用程序基子目录. <con ...

  4. 读经典——《CLR via C#》(Jeffrey Richter著) 笔记_发布者策略控制

    在 读经典——<CLR via C#>(Jeffrey Richter著) 笔记_高级管理控制(配置)中,是由程序集的发布者将程序集的一个新版本发送给管理员,后者安装程序集,并手动编辑应用 ...

  5. 【读书笔记】C#高级编程 第十九章 程序集

    (一)程序集的含义 程序集是.NET用于部署和配置单元的术语. .NET应用程序包含一个或多个程序集.通常扩展名是EXE或DLL的.NET可执行程序称为程序集. 程序集是自我描述的安装单元,由一个或多 ...

  6. 如何在VMware中安装Windows Phone SDK 8.0 (支持模拟器调试)

    相信很多开发者目前的系统还是Win7或Mac,一般不会为了开发某个程序而重装系统,所以我们就需要用到VMware这类的虚拟机来模拟预期的开发环境.在开始介绍前,给大家说明下我当前的软硬件环境,本文所讲 ...

  7. Newtonsoft.Json 版本冲突解决

    在做asp.net MVC 开发时,因为引用的dll 中使用了更高版本的 Newtonsoft.Json ,导致运行时发生错误, 查资料说是因为webApi使用了Newtonsoft.Json 导致了 ...

  8. VS2013新建MVC5项目,使用nuget更新项目引用后发生Newtonsoft.Json引用冲突的解决办法

    错误信息如下: 错误    3    类型“Newtonsoft.Json.JsonPropertyAttribute”同时存在于“c:\Program Files (x86)\Microsoft V ...

  9. dll版本冲突的解决方法

    问题描述 当运行站点或者控制台等程序时,如果项目引用的dll版本与其它dll所依赖的dll版本不一致,就会报未能加载程序集的错误.错误信息为: 未能加载文件或程序集"Newtonsoft.J ...

随机推荐

  1. spring mvc + mybatis + spring aop声明式事务管理没有作用

    在最近的一个项目中,采用springMVC.mybatis,发现一个很恼人的问题:事务管理不起作用!!网上查阅了大量的资料,尝试了各种解决办法,亦未能解决问题! spring版本:3.0.5 myba ...

  2. Java中的事务——JDBC事务和JTA事务

    Java中的事务——JDBC事务和JTA事务 转载:http://www.hollischuang.com/archives/1658 之前的事务介绍基本都是数据库层面的事务,本文来介绍一下J2EE中 ...

  3. 对boost::shared_from_this的进一步封装

    对boost::shared_from_this的进一步封装 熟悉异步编程的同学可能会对boost::shared_from_this有所了解.我们在传入回调的时候,通常会想要其带上当前类对象的上下文 ...

  4. (转) 学习C++ -> 类(Classes)的定义与实现

    学习C++ -> 类(Classes)的定义与实现 一."类" 的介绍    在C++中, 用 "类" 来描述 "对象", 所谓的&q ...

  5. (原)error LNK2038: 检测到“_ITERATOR_DEBUG_LEVEL”的不匹配项: 值“0”不匹配值“2”

    转载请注明出处: http://www.cnblogs.com/darkknightzh/p/5577534.html 在debug下使用intel的mkl库时(release下无此问题),莫名的出现 ...

  6. 【solr专题之四】在Tomcat 中部署Solr4.x

    1.安装Tomcat (1)下载并解压至/opt/tomcat中 # cd /opt/jediael # tar -zxvf apache-tomcat-7.0.54.tar.gz # mv apac ...

  7. web项目配置webAppRootKey 获得根目录 .

    log4j和web.xml配置webAppRootKey 的问题 1 在web.xml配置 <context-param>  <param-name>webAppRootKey ...

  8. nginx+keepalived+tomcat之tomcat性能调优

    body{ font-family: Nyala; font-size: 10.5pt; line-height: 1.5;}html, body{ color: ; background-color ...

  9. ubuntu studio

    相对于普通的的Ubuntu Linux而言,Ubuntu Studio更适合于多媒体设计人员,也就是说Ubuntu Studio更适合经常搞图片和电脑音乐的Linux爱好者们. Ubuntu Stud ...

  10. MySQL--mysqldump的权限说明

    mysqldump 所需要的权限说明: 1.对于table 来说mysqldump 最少要有select 权限. 2.对于view 来说mysqldump 要有show view 权限. 3.对于tr ...