ICorDebugProcess5::EnableNGENPolicy 方法ICorDebugProcess5::EnableNGENPolicy Method

设置一个值,该值确定应用程序在托管调试器下运行时如何加载本机映像。Sets a value that determines how an application loads native images while running under a managed debugger.

语法Syntax

HRESULT EnableNGENPolicy(  
    [in] CorDebugNGENPolicy ePolicy  
);  

参数Parameters

ePolicy
中确定应用程序在托管调试器下运行时如何加载本机映像的CorDebugNGenPolicy常量。[in] A CorDebugNGenPolicy constant that determines how an application loads native images while running under a managed debugger.

备注Remarks

如果策略设置成功,则该方法将返回 S_OKIf the policy is set successfully, the method returns S_OK. 如果 ePolicy 超出了CorDebugNGenPolicy定义的枚举值的范围,则方法将返回 E_INVALIDARG ,并且方法调用不起作用。If ePolicy is outside the range of the enumerated values defined by CorDebugNGenPolicy, the method returns E_INVALIDARG and the method call has no effect. 如果无法更新本机映像生成器(Ngen.exe)的策略,该方法将返回 E_FAILIf the policy of the Native Image Generator (Ngen.exe) cannot be updated, the method returns E_FAIL.

ICorDebugProcess5::EnableNGenPolicy 进程的生存期内随时可以调用方法。The ICorDebugProcess5::EnableNGenPolicy method can be called at any time during the lifetime of the process. 此策略对设置策略后加载的任何模块有效。The policy is in effect for any modules that are loaded after the policy is set.

要求Requirements

平台: 请参阅系统要求Platforms: See System Requirements.

标头:CorDebug.idl、CorDebug.hHeader: CorDebug.idl, CorDebug.h

库: CorGuids.libLibrary: CorGuids.lib

.NET Framework 版本:自 4.5 之后可用Available since 4.5.NET Framework Versions: 自 4.5 之后可用Available since 4.5

请参阅See also