📅  最后修改于: 2022-03-11 14:48:55.484000             🧑  作者: Mango
private static void CreateAppPool(string poolname,bool enable32bitOn64, ManagedPipelineMode mode,string runtimeVersion="v4.0")
{
using (ServerManager serverManager = new ServerManager())
{
ApplicationPool newPool = serverManager.ApplicationPools.Add(poolname);
newPool.ManagedRuntimeVersion = runtimeVersion;
newPool.Enable32BitAppOnWin64 = true;
newPool.ManagedPipelineMode = mode;
serverManager.CommitChanges();
}
}