ProcessHost.SetApplicationPreloadState(String, String, Boolean) 方法

定义

通知 ASP.NET 在 IIS 7.0 上运行的特定应用程序已配置为预先加载。Notifies ASP.NET that a particular application that is running on IIS 7.0 is configured to be preloaded.

此 API 支持产品基础结构,不能在代码中直接使用。

public:
 virtual void SetApplicationPreloadState(System::String ^ context, System::String ^ appId, bool enabled);
public void SetApplicationPreloadState (string context, string appId, bool enabled);
abstract member SetApplicationPreloadState : string * string * bool -> unit
override this.SetApplicationPreloadState : string * string * bool -> unit
Public Sub SetApplicationPreloadState (context As String, appId As String, enabled As Boolean)

参数

context
String

应用程序上下文。The application context.

appId
String

应用程序的唯一 ID。The unique ID of the application.

enabled
Boolean

如果指示应预加载应用程序,则为 true;否则为 falsetrue to indicate the application should be preloaded; otherwise, false.

实现

例外

包含预加载应用程序的信息的 IApplicationPreloadUtil 实例为 null 或空。The IApplicationPreloadUtil instance that contains information for preloading the application is null or empty.

- 或 --or-

appIdnull 或空。appId is null or empty.

- 或 --or-

enabled 设置为 true,并且进程宿主以前未将 IApplicationPreloadUtil 接口传递至其 SetApplicationPreloadUtil(IApplicationPreloadUtil) 方法enabled is set to true and the process host was not previously passed an IApplicationPreloadUtil interface to its SetApplicationPreloadUtil(IApplicationPreloadUtil) method

注解

此方法实现 SetApplicationPreloadState 接口的方法 IApplicationPreloadManagerThis method implements the SetApplicationPreloadState method of the IApplicationPreloadManager interface. IIS 7.0 调用 SetApplicationPreloadState 方法,以通知 ASP.NET 加载的应用程序是否支持预加载。IIS 7.0 calls the SetApplicationPreloadState method to notify ASP.NET whether the application that is being loaded supports preloading.

备注

此方法仅适用于在 IIS 7.0 上运行的应用程序。This method applies only to applications that run on IIS 7.0.

适用于