<dependentAssembly > 元素<dependentAssembly> Element

封装每个程序集的绑定策略和程序集位置。Encapsulates binding policy and assembly location for each assembly. 为每个程序集使用一个 dependentAssembly 元素。Use one dependentAssembly element for each assembly.

<configuration> <configuration>
    <runtime >   <runtime>
        <assemblyBinding >     <assemblyBinding>
       <dependentAssembly >      <dependentAssembly>



特性和元素Attributes and Elements

下列各节描述了特性、子元素和父元素。The following sections describe attributes, child elements, and parent elements.



子元素Child Elements

元素Element 描述Description
assemblyIdentity 包含有关程序集的标识信息。Contains identifying information about the assembly. 每个 dependentAssembly 元素中必须包含此元素。This element must be included in each dependentAssembly element.
codeBase 指定运行时在计算机上未安装共享程序集的情况下可以找到该程序集的位置。Specifies where the runtime can find a shared assembly if it is not installed on the computer.
bindingRedirect 将一个程序集版本重定向到另一个版本。Redirects one assembly version to another.
publisherPolicy 指定运行时是否应用此程序集的发布服务器策略。Specifies whether the runtime applies publisher policy for this assembly.

父元素Parent Elements

元素Element 描述Description
assemblyBinding 包含有关程序集版本重定向和程序集位置的信息。Contains information about assembly version redirection and the locations of assemblies.
configuration 公共语言运行时和 .NET Framework 应用程序所使用的每个配置文件中的根元素。The root element in every configuration file used by the common language runtime and .NET Framework applications.
runtime 包含有关程序集绑定和垃圾回收的信息。Contains information about assembly binding and garbage collection.


下面的示例演示如何封装两个程序集的程序集信息。The following example shows how to encapsulate assembly information for two assemblies.

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

请参阅See also