Share via


<dependentAssembly> 元素

更新:2007 年 11 月

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

<configuration> 元素
  <runtime> 元素
    <runtime> -> <assemblyBinding> 元素
      <dependentAssembly> 元素

<dependentAssembly> 
</dependentAssembly>

属性和元素

下面几部分描述了属性、子元素和父元素。

属性

无。

子元素

元素

说明

assemblyIdentity

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

codeBase

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

bindingRedirect

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

publisherPolicy

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

父元素

元素

说明

assemblyBinding

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

configuration

公共语言运行库和 .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>

请参见

概念

重定向程序集版本

参考

运行库设置架构

其他资源

.NET Framework 的配置文件架构