Permalink
Browse files

SiteManager should clean up user directory on removing site

Fixes issue #184
  • Loading branch information...
1 parent b9c57f3 commit 37906f32365c308dd2a7533ef356281362be26e7 @pranavkm pranavkm committed Oct 17, 2012
Showing with 5 additions and 0 deletions.
  1. +5 −0 Kudu.SiteManagement/SiteManager.cs
View
5 Kudu.SiteManagement/SiteManager.cs
@@ -216,6 +216,11 @@ public void DeleteSite(string applicationName)
// Remove the app pool and commit changes
iis.ApplicationPools.Remove(iis.ApplicationPools[appPoolName]);
iis.CommitChanges();
+
+ // Clear out the app pool user profile directory if it exists
+ string userDir = Path.GetDirectoryName(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile).TrimEnd(Path.DirectorySeparatorChar));
+ string appPoolDirectory = Path.Combine(userDir, appPoolName);
+ DeleteSafe(appPoolDirectory);
}
}

0 comments on commit 37906f3

Please sign in to comment.