This documentation is archived and is not being maintained.

ICLRPolicyManager::SetActionOnTimeout Method

Specifies the policy action the common language runtime (CLR) should take when the specified operation times out.

HRESULT SetActionOnTimeout (
    [in] EClrOperation operation,
    [in] EPolicyAction action


[in] One of the EClrOperation values, indicating the operation for which to specify the timeout action. The following values are supported:

  • OPR_AppDomainUnload

  • OPR_ProcessExit

  • OPR_ThreadRudeAbortInCriticalRegion

  • OPR_ThreadRudeAbortInNonCriticalRegion


[in] One of the EPolicyAction values, indicating the policy action to be taken when the operation times out.




SetActionOnTimeout returned successfully.


The CLR has not been loaded into a process, or the CLR is in a state in which it cannot run managed code or process the call successfully.


The call timed out.


The caller does not own the lock.


An event was canceled while a blocked thread or fiber was waiting on it.


An unknown catastrophic failure occurred. After a method returns E_FAIL, the CLR is no longer usable within the process. Subsequent calls to hosting methods return HOST_E_CLRNOTAVAILABLE.


A timeout cannot be set for the specified operation, or an invalid value was supplied for operation.

The timeout value can be either the default timeout set by the CLR, or a value specified by the host in a call to the ICLRPolicyManager::SetTimeout method.

Not all policy action values can be specified as the timeout behavior for CLR operations. SetActionOnTimeout is typically used only to escalate behavior. For example, a host can specify that thread aborts be turned into rude thread aborts, but cannot specify the opposite. The table below describes the valid action values for valid operation values.

Value for operation

Valid values for action



  • eRudeAbortThread

  • eUnloadAppDomain

  • eRudeUnloadAppDomain

  • eExitProcess

  • eFastExitProcess

  • eRudeExitProcess

  • eDisableRuntime


  • eUnloadAppDomain

  • eRudeUnloadAppDomain

  • eExitProcess

  • eFastExitProcess

  • eRudeExitProcess

  • eDisableRuntime


  • eExitProcess

  • eFastExitProcess

  • eRudeExitProcess

  • eDisableRuntime

Platforms: See .NET Framework System Requirements.

Header: MSCorEE.h

Library: Included as a resource in MSCorEE.dll

.NET Framework Versions: 4, 3.5 SP1, 3.5, 3.0 SP1, 3.0, 2.0 SP1, 2.0