Create an application pool that uses .NET 4.0

前端 未结 3 894
轮回少年
轮回少年 2021-02-01 17:43

I use the following code to create a app pool:

var metabasePath = string.Format(@\"IIS://{0}/W3SVC/AppPools\", serverName);
DirectoryEntry newpool;
DirectoryEntr         


        
3条回答
  •  借酒劲吻你
    2021-02-01 18:39

    newpool.Properties["ManagedRuntimeVersion"].Value = "v4.0";
    

    Will do the same thing as the Microsoft.Web.Administration.dll but using DirectoryEntry

    Also

    newPool.InvokeSet("ManagedPipelineMode", new object[] { 0 });
    

    Will switch to integrated or classic pipeline mode using DirectoryEntry.

提交回复
热议问题