System.Runtime.CompilerServices.DependencyAttribute Class

Indicates when a dependency is to be loaded by the referring assembly. This class cannot be inherited.

See Also: DependencyAttribute Members

Syntax

[System.AttributeUsage(System.AttributeTargets.Assembly, AllowMultiple=true)]
public sealed class DependencyAttribute : Attribute

Remarks

This attribute is used by the Native Image Generator (Ngen.exe) to generate native assembly images.

Apply the System.Runtime.CompilerServices.DependencyAttribute attribute to a dependent assembly with a value of the System.Runtime.CompilerServices.LoadHint enumeration to specify when a referring assembly is to load a dependency.

A dependency that is likely to be loaded (LoadHint.Always) will cause Ngen.exe to bind to that dependency. Using this hint allows Ngen.exe to generate code that will result in a reduced working set and improved throughput but at the cost of always loading the dependency when the parent assembly is loaded.

Requirements

Namespace: System.Runtime.CompilerServices
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0