LoaderOptimization 枚举

定义

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
继承
LoaderOptimization
属性

字段

DisallowBindings 4

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

DomainMask 3

请勿使用。Do not use. 此掩码选择与域相关的值,筛选出未使用的 DisallowBindings 标志。This mask selects the domain-related values, screening out the unused DisallowBindings flag.

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 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 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 1

指示应用程序可能有一个域,加载程序不得在应用程序域之间共享内部资源。Indicates that the application will probably have a single domain, and loader must not share internal resources across application domains.

注解

仅 .NET Framework:MultiDomainHost 从 .NET Framework 版本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 属性,并使用 MultiDomain 标志创建 AppDomain,该效果与指定 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.

适用于

另请参阅