LoaderOptimization LoaderOptimization LoaderOptimization LoaderOptimization Enum

Definition

An enumeration used with the LoaderOptimizationAttribute class to specify loader optimizations for an executable.

public enum class LoaderOptimization
[System.Runtime.InteropServices.ComVisible(true)]
public enum LoaderOptimization
type LoaderOptimization = 
Public Enum LoaderOptimization
Inheritance
LoaderOptimizationLoaderOptimizationLoaderOptimizationLoaderOptimization
Attributes

Fields

DisallowBindings DisallowBindings DisallowBindings DisallowBindings 4

Ignored by the common language runtime.

DomainMask DomainMask DomainMask DomainMask 3

Do not use. This mask selects the domain-related values, screening out the unused DisallowBindings flag.

MultiDomain MultiDomain MultiDomain MultiDomain 2

Indicates that the application will probably have many domains that use the same code, and the loader must share maximal internal resources across application domains.

MultiDomainHost MultiDomainHost MultiDomainHost MultiDomainHost 3

Indicates that the application will probably host unique code in multiple domains, and the loader must share resources across application domains only for globally available (strong-named) assemblies that have been added to the global assembly cache.

NotSpecified NotSpecified NotSpecified NotSpecified 0

Indicates that no optimizations for sharing internal resources are specified. If the default domain or hosting interface specified an optimization, then the loader uses that; otherwise, the loader uses SingleDomain.

SingleDomain SingleDomain SingleDomain SingleDomain 1

Indicates that the application will probably have a single domain, and loader must not share internal resources across application domains.

Remarks

The meaning of MultiDomainHost changed in the .NET Framework version 2.0. The loader now shares resources across application domains only for assemblies that have been added to the global assembly cache.

Note

If custom code access security policy is set for the AppDomain, by using the SetAppDomainPolicy property, and the SetAppDomainPolicy is created using the MultiDomain flag, the effect is the same as specifying the MultiDomainHost flag; that is, only assemblies in the GAC are shared. When this occurs, the loader does not throw an exception and the application does not experience the performance gains associated with the MultiDomain flag.

For more information on assembly sharing and domain-neutral assembly loading, see Application Domains and Assemblies.

Applies to

See Also