System.Runtime.CompilerServices.DefaultDependencyAttribute Class

Provides a hint to the common language runtime (CLR) indicating how likely a dependency is to be loaded. This class is used in a dependent assembly to indicate what hint should be used when the parent does not specify the System.Runtime.CompilerServices.DependencyAttribute attribute. This class cannot be inherited.

See Also: DefaultDependencyAttribute Members

Syntax

[System.AttributeUsage(System.AttributeTargets.Assembly)]
public sealed class DefaultDependencyAttribute : Attribute

Remarks

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

Apply the System.Runtime.CompilerServices.DefaultDependencyAttribute attribute to a dependent assembly to determine the preferred default binding.

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.

When you apply the System.Runtime.CompilerServices.DependencyAttribute attribute to an assembly with a value of LoadHint.Default, the native image generation service consults the dependent assembly for its preferred default binding, which is specified by the System.Runtime.CompilerServices.DefaultDependencyAttribute attribute.

Requirements

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