Last post Mar 12, 2020 06:01 AM by robby32
Mar 12, 2020 05:40 AM|robby32|LINK
I have a webiste under sites in IIS, not Default Web Sites called TestWCF .
I have an application pool called TestWCF associated with the site.
Now I want to delete the site , but first I need to delete the Application pool (is that right or can it be done in one hit ?)
I do the following :
var name = "TestWCF"
using (ServerManager serverManager = new ServerManager())
SiteCollection sites = serverManager.Sites;
foreach (var dsite in sites)
if (dsite.Name.Trim() == name.Trim())
// how can i delete the site her ??
Mar 12, 2020 06:01 AM|robby32|LINK
I worked it out ... for anyone else who needs a solution here it is
var name = "TestWCF" S
erverManager manager = new ServerManager();
Site siteToRemove = manager.Sites[name];