DependencyAttribute クラス
アセンブリ: mscorlib (mscorlib.dll 内)

<SerializableAttribute> _ <AttributeUsageAttribute(AttributeTargets.Assembly, AllowMultiple:=True)> _ Public NotInheritable Class DependencyAttribute Inherits Attribute
[SerializableAttribute] [AttributeUsageAttribute(AttributeTargets.Assembly, AllowMultiple=true)] public sealed class DependencyAttribute : Attribute
[SerializableAttribute] [AttributeUsageAttribute(AttributeTargets::Assembly, AllowMultiple=true)] public ref class DependencyAttribute sealed : public Attribute

この属性は、ネイティブ アセンブリのイメージを生成するために ネイティブ イメージ ジェネレータ (Ngen.exe) が使用します。
どのような場合に参照元アセンブリが依存関係を読み込むかを指定するには、LoadHint 列挙体の値を使用して DependencyAttribute 属性を依存アセンブリに適用します。
Ngen.exe は、読み込まれる可能性の高い依存関係 (Always) にバインドします。このヒントを使用すると、Ngen.exe は、ワーキング セットを縮小し、スループットを向上するコードを生成できますが、親アセンブリが読み込まれるときに必ず依存関係が読み込まれます。

ネイティブ イメージの生成サービスを常に AssemblyA にバインドし、場合によっては AssemblyB にバインドするように指定するコード例を次に示します。
Imports System.Runtime.CompilerServices <Assembly: DependencyAttribute("AssemblyA", LoadHint.Always)> <Assembly: DependencyAttribute("AssemblyB", LoadHint.Sometimes)> Module Program Sub Main(ByVal args() As String) Console.WriteLine("The DependencyAttribute attribute was applied.") End Sub End Module
using System; using System.Runtime.CompilerServices; [assembly: DependencyAttribute("AssemblyA", LoadHint.Always)] [assembly: DependencyAttribute("AssemblyB", LoadHint.Sometimes)] class Program { static void Main(string[] args) { Console.WriteLine("The DependencyAttribute attribute was applied."); } }

System.Attribute
System.Runtime.CompilerServices.DependencyAttribute


Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


- DependencyAttribute クラスのページへのリンク