From 4e8930c69d5102720738ae5ca725cdf9260a741b Mon Sep 17 00:00:00 2001 From: Sergey Date: Fri, 10 Aug 2012 13:38:15 +0300 Subject: [PATCH] patch for http://websitepanel.codeplex.com/workitem/9 issue When users install Helcon Ape their sites go down with error WebsitePanel IIS Modules Error AuthName directive not found. --- .../WebsitePanel.Providers.Web.IIS70/IIs70.cs | 32 ++++++++++++------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/IIs70.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/IIs70.cs index b8a89893..a773dae2 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/IIs70.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/IIs70.cs @@ -98,6 +98,8 @@ namespace WebsitePanel.Providers.Web public const string AspNet40x64PathSetting = "AspNet40x64Path"; public const string WEBSITEPANEL_IISMODULES = "WebsitePanel.IIsModules"; + public const string DOTNETPANEL_IISMODULES = "DotNetPanel.IIsModules"; + public const string HeliconApeModule = "Helicon Ape"; public const string HeliconApeHandlerPath = "*.apehandler"; @@ -1691,7 +1693,10 @@ namespace WebsitePanel.Providers.Web // foreach (var moduleEntry in modulesCollection) { - if (String.Equals(moduleEntry["name"].ToString(), Constants.WEBSITEPANEL_IISMODULES, StringComparison.InvariantCultureIgnoreCase)) + if ( + String.Equals(moduleEntry["name"].ToString(), Constants.WEBSITEPANEL_IISMODULES, StringComparison.InvariantCultureIgnoreCase) + || String.Equals(moduleEntry["name"].ToString(), Constants.DOTNETPANEL_IISMODULES, StringComparison.InvariantCultureIgnoreCase) + ) return true; } // @@ -1829,22 +1834,27 @@ namespace WebsitePanel.Providers.Web // ConfigurationElementCollection modulesCollection = modulesSection.GetCollection(); // - ConfigurationElement iisModulesEntry = null; - // foreach (ConfigurationElement moduleEntry in modulesCollection) { if (String.Equals(moduleEntry["name"].ToString(), Constants.WEBSITEPANEL_IISMODULES, StringComparison.InvariantCultureIgnoreCase)) { - iisModulesEntry = moduleEntry; - break; + modulesCollection.Remove(moduleEntry); + break; } + } - // - if (iisModulesEntry != null) - { - modulesCollection.Remove(iisModulesEntry); - srvman.CommitChanges(); - } + + foreach (ConfigurationElement moduleEntry in modulesCollection) + { + if (String.Equals(moduleEntry["name"].ToString(), Constants.DOTNETPANEL_IISMODULES, StringComparison.InvariantCultureIgnoreCase)) + { + modulesCollection.Remove(moduleEntry); + break; + } + } + + srvman.CommitChanges(); + } }