This thread is related to Microsoft.Web.Administration.
I know that creation of a new ServerManager object is initialized from the apphostconfig file on the server it is running on.
ServerManager serverManager = new ServerManager();
I see a lot of examples to create an application pool or web site by name and this worksfine:
serverManager.ApplicationPools.Add("New App Pool");
Or alternately,
applicationPool = serverManager.ApplicationPools.CreateElement();
serverManager.ApplicationPools.Add(element);
I could not figure out a way to create a new application pool from an xml configuration (not from the apphost so I am not speaking ofGetApplicationHostConfiguration).
So the question boils down to:
Is there a way to create a new application pool deserialized from an xml/config?
I am looking to do the following:
// somehow create a new instance of ApplicationPool or read from config or xml settings for a new app pool
// in case of XML metadata or external config would have the same schema as <system.applicationHost/ApplicationPools>
ApplicationPool appPool = /*need code here to read or deserialize new settings from XML*/
//Then set the properties for this app pool or load from XML in previous step
appPool.Name ="App pool Name";
appPool.ManagedPipelineMode = ManagedPipelineMode.Integrated;
.....
//And then add the "new" app pool to the server
serverManager.ApplicationPools.Add(appPool);
Any help or direction would be great!
Thanks.
Talha