LoaderOptimization LoaderOptimization LoaderOptimization LoaderOptimization Enum

定义

一个枚举,它与 LoaderOptimizationAttribute 类一起使用为可执行文件指定加载程序优化。An enumeration used with the LoaderOptimizationAttribute class to specify loader optimizations for an executable.

public enum class LoaderOptimization
[System.Runtime.InteropServices.ComVisible(true)]
[System.Serializable]
public enum LoaderOptimization
type LoaderOptimization = 
Public Enum LoaderOptimization
继承
LoaderOptimizationLoaderOptimizationLoaderOptimizationLoaderOptimization
属性

字段

DisallowBindings DisallowBindings DisallowBindings DisallowBindings 4

被公共语言运行时忽略。Ignored by the common language runtime.

DomainMask DomainMask DomainMask DomainMask 3

请勿使用。Do not use. 此掩码选择与域相关的值,筛选出未使用的 DisallowBindings 标志。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. 如果默认域或宿主接口指定了优化,则加载程序将使用该优化;否则,加载程序将使用 SingleDomainIf 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.

注解

仅 .NET Framework: 从 .NET Framework 版本MultiDomainHost 2.0 开始更改的含义。.NET Framework only: The meaning of MultiDomainHost changed starting with .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.

备注

仅 .NET Framework: 如果为AppDomain指定了自定义代码访问安全策略, 则通过SetAppDomainPolicy使用属性, 并AppDomain使用MultiDomain标志创建, 效果与指定MultiDomainHost标志相同; 即, 只有GAC 是共享的。.NET Framework only: If custom code access security policy is set for the AppDomain, by using the SetAppDomainPolicy property, and the AppDomain 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. 发生这种情况时, 加载程序不会引发异常, 应用程序也不会遇到与MultiDomain标志相关的性能提升。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.

适用于

另请参阅