### AppCreate2

You can use the AppCreate2 method of the IIsWebDirectory or IIsWebVirtualDir object to create a Web application definition and mark it as running in-process, out-of-process, or in a process pool. If an application already exists at the specified path, you can use this method to reconfigure the application to run in whatever process space you want.

###### Syntax

DirObj.AppCreate2 InProcFlag

###### Parameters

DirObj
  An IIS Admin Object of type IIsWebDirectory or IIsWebVirtualDir.
InProcFlag
  Binary value that specifies whether the application being created is to run in-process (0), out-of-process (1), or in a pooled process (2). If the application already exists and is running , changing the value of this flag will cause the application definition to be deleted and a new application created to run in the specified process space.

###### Code Example

    <%
      Dim DirObj
      Const INPROC = 0
      Const OUTPROC = 1
      Const POOLED = 2
      Set DirObj = GetObject("IIS://LocalHost/W3SVC/1/ROOT/MyAppDir")
      'Create an application in-process.
      DirObj.AppCreate INPROC
    %>

###### See Also

AppCreate, AppDelete, AppDeleteRecursive, AppUnload, AppUnloadRecursive, AppGetStatus, AppDisable, AppDisableRecursive, AppEnable, AppEnableRecursive, AspAppRestart

© 1997-2001 Microsoft Corporation. All rights reserved.