<runtime> 的 <assemblyBinding> 元素
一.<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>标记。 |
|
指定加载程序集时公共语言运行时搜索的子目录。 |
|
指定运行时是否采用出版商策略。 |
|
指定当使用程序集的部分名称时应动态加载的程序集全名。 |
父元素
元素 |
说明 |
---|---|
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> 元素的更多相关文章
- <runtime> 的 <assemblyIdentity> 元素和<bindingRedirect> 元素
1.<assemblyIdentity> 元素 包含关于该程序集的标识信息. <assemblyIdentity name="assembly name" pub ...
- C# 自定义exe引用的dll路径
MSDN原文:https://msdn.microsoft.com/library/twy1dw1e(v=vs.100).aspx <runtime> 的 <assemblyBind ...
- probing元素
https://msdn.microsoft.com/zh-cn/library/823z9h8w(v=vs.85).aspx 指定加载程序集时公共语言运行库要搜索的应用程序基子目录. <con ...
- 读经典——《CLR via C#》(Jeffrey Richter著) 笔记_发布者策略控制
在 读经典——<CLR via C#>(Jeffrey Richter著) 笔记_高级管理控制(配置)中,是由程序集的发布者将程序集的一个新版本发送给管理员,后者安装程序集,并手动编辑应用 ...
- 【读书笔记】C#高级编程 第十九章 程序集
(一)程序集的含义 程序集是.NET用于部署和配置单元的术语. .NET应用程序包含一个或多个程序集.通常扩展名是EXE或DLL的.NET可执行程序称为程序集. 程序集是自我描述的安装单元,由一个或多 ...
- 如何在VMware中安装Windows Phone SDK 8.0 (支持模拟器调试)
相信很多开发者目前的系统还是Win7或Mac,一般不会为了开发某个程序而重装系统,所以我们就需要用到VMware这类的虚拟机来模拟预期的开发环境.在开始介绍前,给大家说明下我当前的软硬件环境,本文所讲 ...
- Newtonsoft.Json 版本冲突解决
在做asp.net MVC 开发时,因为引用的dll 中使用了更高版本的 Newtonsoft.Json ,导致运行时发生错误, 查资料说是因为webApi使用了Newtonsoft.Json 导致了 ...
- VS2013新建MVC5项目,使用nuget更新项目引用后发生Newtonsoft.Json引用冲突的解决办法
错误信息如下: 错误 3 类型“Newtonsoft.Json.JsonPropertyAttribute”同时存在于“c:\Program Files (x86)\Microsoft V ...
- dll版本冲突的解决方法
问题描述 当运行站点或者控制台等程序时,如果项目引用的dll版本与其它dll所依赖的dll版本不一致,就会报未能加载程序集的错误.错误信息为: 未能加载文件或程序集"Newtonsoft.J ...
随机推荐
- HTML中将背景颜色渐变
通过使用 css3 渐变可以让背景两个或多个指定的颜色之间显示平稳的过渡,由于用到css3所以需要考虑下浏览器兼容问题,例如:从左到右的线性渐变,且带有透明度的样式:#grad {background ...
- T-SQL 函数概述
T-SQL函数的类别和描述: 函数类别 作用 聚合函数 返回一个标量值,表示在某个值域上的聚合,应用于特定的聚合选择或者汇总 配置变量 返回SQL Server执行环境的信息.这些信息可用于给对象编程 ...
- myeclipse8.6 for spring环境配置
- spring mvc ajax
<%@ page contentType="text/html;charset=UTF-8" %> <%@ include file="/WEB-INF ...
- (转)ubuntu 文件目录结构
文件系统的类型 LINUX有四种基本文件系统类型:普通文件.目录文件.连接文件和特殊文件,可用file命令来识别. 1. 普通文件:如文本文件.C语言元代码.SHELL脚本.二进制的可执行文件等,可用 ...
- 如何成为一个真正在路上的Linuxer
Linux 是工具,却更像一个信仰. 写在前面: 本文目的不是教你如何成为一个真正的Linuxer,也没有能力教你成为一个真正的linuxer,而是通过笔者的一些想法试图指引你真正踏上学习linux之 ...
- Oracle中使用escape关键字实现like匹配特殊字符,以及&字符的转义
http://blog.chinaunix.net/uid-26896647-id-3433968.html http://soft.chinabyte.com/database/398/124298 ...
- C# Cookie编程
Cookie,他最早出现是在Netscape Navigator 2.0中.Cookie其实就是由Web服务器创建的.将信息存储在机上的文件.那么为什么Web服务器要在客户机上面创建如此文件?这是因为 ...
- UESTC_韩爷的情书 2015 UESTC Training for Graph Theory<Problem H>
H - 韩爷的情书 Time Limit: 6000/2000MS (Java/Others) Memory Limit: 262144/262144KB (Java/Others) Subm ...
- Jump Game II 解答
Question Given an array of non-negative integers, you are initially positioned at the first index of ...