Check out this post http://forums.iis.net/t/1061734.aspx, it will give some rough idea about Microsoft.Web.Administration dll.
I have not studied the whole concept but I figured how to create new pool and how to attach with new web site / virtual directory.
Creating Application Pool
Microsoft.Web.Administration.ServerManager manager = new Microsoft.Web.Administration.ServerManager();
manager.ApplicationPools.Add("NewApplicationPool");
manager.CommitChanges();
Attaching with existing virtual directory
Microsoft.Web.Administration.ServerManager manager = new Microsoft.Web.Administration.ServerManager();
Site defaultSite = manager.Sites["Default Web Site"];
// defaultSite.Applications will give you the list of 'this' web site reference and all
// virtual directories inside it -- 0 index is web site itself.
Microsoft.Web.Administration.Application oVDir = defaultSite.Applications["/myApp"];
oVDir.ApplicationPoolName = "NewApplicationPool";
manager.CommitChanges();
This way you can assign application pool to your new website using the custom actions, overriding the commit method of installer class.
If still find yourself struggling, please let me know and I'll try to send the code.
Regards
Faiyaz
[email protected]
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…