LoaderOptimization 列舉

定義

可搭配 LoaderOptimizationAttribute 類別來指定可執行檔之載入器最佳化的列舉。An enumeration used with the LoaderOptimizationAttribute class to specify loader optimizations for an executable.

public enum class LoaderOptimization
public enum LoaderOptimization
[System.Serializable]
public enum LoaderOptimization
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public enum LoaderOptimization
type LoaderOptimization = 
[<System.Serializable>]
type LoaderOptimization = 
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type LoaderOptimization = 
Public Enum LoaderOptimization
繼承
LoaderOptimization
屬性

欄位

DisallowBindings 4

Common Language Runtime 已忽略。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 屬性並使用旗標建立,則 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. 發生這種情況時,載入器不會擲回例外狀況,而且應用程式不會遇到與旗標相關聯的效能提升 MultiDomainWhen 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.

適用於

另請參閱