<dependentAssembly> 項目

封裝每一個組件的繫結原則和組件位置。為每個組件 (Assembly) 使用一個 dependentAssembly 項目。

<configuration> 項目
  <runtime> 項目
    <assemblyBinding> 項目
      <dependentAssembly> 項目

<dependentAssembly> 
</dependentAssembly>

屬性和項目

下列小節描述屬性、子項目和父項目。

屬性

子項目

項目 說明

assemblyIdentity

包含有關組件的識別資訊。這個項目必須包含在每個 dependentAssembly 項目之中。

codeBase

指定執行階段可以找到共用組件的位置,如果它沒有被安裝在電腦上的話。

bindingRedirect

將一個組件版本重新導向為另一個版本。

publisherPolicy

指定執行階段是否為這個組件套用發行者原則。

父項目

項目 說明

assemblyBinding

包含有關組件版本重新導向和組件位置的資訊。

configuration

每一個組態檔中的根 (Root) 項目是由 Common Language 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>

請參閱

參考

執行階段設定結構描述

概念

重新導向組件版本

其他資源

.NET Framework 的組態檔結構描述