<runtime> の <assemblyIdentity> 要素

アセンブリに関する識別情報が含まれています。

configuration
  runtime
    <assemblyBinding>
      <dependentAssembly>
        <assemblyIdentity>

構文

   <assemblyIdentity
name="assembly name"  
publicKeyToken="public key token"  
culture="assembly culture"/>  

属性および要素

以降のセクションでは、属性、子要素、および親要素について説明します。

属性

属性 説明
name 必須の属性です。

アセンブリの名前
culture 省略可能な属性です。

アセンブリの言語と国および地域を指定する文字列。
publicKeyToken 省略可能な属性です。

アセンブリの厳密な名前を示す 16 進値。
processorArchitecture 省略可能な属性です。

"x86"、"amd64"、"msil"、"ia64" のいずれか。プロセッサ固有コードが含まれるアセンブリのプロセッサ アーキテクチャを指定します。 値の大文字小文字は区別されません。 属性にその他の値が割り当てられる場合、<assemblyIdentity> 要素全体が無視されます。 以下を参照してください。ProcessorArchitecture

processorArchitecture 属性

[値] 説明
amd64 AMD x86-64 アーキテクチャのみ。
ia64 Intel Itanium アーキテクチャのみ。
msil プロセッサおよびワードあたりのビット数に関して中立
x86 32 ビット x86 プロセッサ (ネイティブまたは 64 ビット プラットフォーム上の Windows on Windows (WOW) 環境)。

子要素

なし。

親要素

要素 説明
assemblyBinding アセンブリ バージョンのリダイレクトおよびアセンブリの位置に関する情報が含まれます。
configuration 共通言語ランタイムおよび .NET Framework アプリケーションで使用されるすべての構成ファイルのルート要素です。
dependentAssembly 各アセンブリのバインディング ポリシーとアセンブリの場所をカプセル化します。 アセンブリごとに <dependentAssembly> 要素を 1 つ使用します。
runtime アセンブリのバインディングとガベージ コレクションに関する情報が含まれています。

解説

すべての <dependentAssembly> 要素には <assemblyIdentity> 子要素が 1 つ必要です。

processorArchitecture 属性が存在する場合、<assemblyIdentity> 要素は、対応するプロセッサ アーキテクチャを持つアセンブリにのみ適用されます。 processorArchitecture 属性が存在しない場合、<assemblyIdentity> 要素は、何らかのプロセッサ アーキテクチャを持つアセンブリに適用できます。

次の例では、2 つのアセンブリに対する構成ファイルを確認できます。この 2 つのアセンブリは名前が同じで、2 つの異なる 2 プロセッサ アーキテクチャを対象としており、そのバージョンは同期で保守管理されていません。アプリケーションが x86 プラットフォーム上で実行されると、最初の <assemblyIdentity> 要素が適用され、もう 1 つは無視されます。 アプリケーションが x86 でも ia64 でもないプラットフォーム上で実行される場合、両方が無視されます。

<configuration>  
   <runtime>  
      <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">  
         <dependentAssembly>  
            <assemblyIdentity name="MyAssembly"  
                  publicKeyToken="14a739be0244c389"  
                  culture="neutral"  
                  processorArchitecture="x86" />  
            <bindingRedirect oldVersion= "1.0.0.0"
                  newVersion="1.1.0.0" />  
         </dependentAssembly>  
         <dependentAssembly>  
            <assemblyIdentity name="MyAssembly"  
                  publicKeyToken="14a739be0244c389"  
                  culture="neutral"
                  processorArchitecture="ia64" />  
            <bindingRedirect oldVersion="1.0.0.0"
                  newVersion="2.0.0.0" />  
         </dependentAssembly>  
      </assemblyBinding>  
   </runtime>  
</configuration>  

processorArchitecture 属性を持たない <assemblyIdentity> 要素が構成ファイルに含まれているとき、プラットフォームを照合する要素が含まれていない場合、processorArchitecture 属性のない要素が使用されます。

次の例では、アセンブリに関する情報を提供する方法を確認できます。

<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>  
      </assemblyBinding>  
   </runtime>  
</configuration>  

関連項目