【发布时间】:2012-07-19 17:12:54
【问题描述】:
(使用 IronPython),我正在添加一个应用程序池,如下所示,但应用程序池不会显示在 Internet 信息服务 (IIS) 管理器中。
有人知道为什么会出现这种差异吗?这是有效的,因为我在查看应用程序池 (serverManager.ApplicationPools) 时看到了我添加的应用程序池。
import clr
clr.AddReference("Microsoft.Web.Administration")
from Microsoft.Web.Administration import *
import getpass
current_user = System.Security.Principal.WindowsIdentity.GetCurrent().Name
serverManager = ServerManager()
app_pool = serverManager.ApplicationPools.Add("my pool name")
app_pool.AutoStart = True
app_pool.ManagedPipelineMode = ManagedPipelineMode.Integrated
app_pool.ManagedRuntimeVersion = "v2.0"
app_pool.ProcessModel.IdentityType = ProcessModelIdentityType.SpecificUser
app_pool.ProcessModel.UserName = current_user
app_pool.ProcessModel.Password = getpass.getpass("Password:")
serverManager.CommitChanges()
【问题讨论】: