Skip to content

Commit 94e37db

Browse files
committed
Trying to remove the broken entry first.
1 parent 7828b7b commit 94e37db

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

eFormAPI/Installation/CustomActions/CustomAction.cs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ public static ActionResult UpdateCA(Session session)
349349
IncrementProgressBar(session);
350350

351351
session.Log("AddImageHandlers called");
352-
AddImageHandlers(uiName);
352+
AddImageHandlers(webApiName);
353353
IncrementProgressBar(session);
354354

355355

@@ -652,12 +652,14 @@ private static void AddImageHandlers(string siteName)
652652
{
653653
//MessageBox.Show("AddImageHandlers called for siteName " + siteName);
654654

655-
var config = serverManager.GetWebConfiguration(siteName);
656-
var handlersSection = config.GetSection("system.webServer/handlers");
657-
var handlersCollection = handlersSection.GetCollection();
655+
Configuration config = serverManager.GetWebConfiguration(siteName);
656+
657+
ConfigurationSection handlersSection = config.GetSection("system.webServer/handlers");
658+
ConfigurationElementCollection handlersCollection = handlersSection.GetCollection();
658659
bool pngHandlerMissing = true;
659660
bool jpgHandlerMissing = true;
660661
bool jpegHandlerMissing = true;
662+
//ConfigurationElement toRemoveCe;
661663

662664
foreach (ConfigurationElement ce in handlersCollection)
663665
{
@@ -676,6 +678,10 @@ private static void AddImageHandlers(string siteName)
676678
MessageBox.Show("jpegHandlerMissing");
677679
jpegHandlerMissing = false;
678680
}
681+
if (ce.GetAttributeValue("name").ToString() == "ExtensionlessUrlHandler-Integrated-4.0")
682+
{
683+
handlersCollection.Remove(ce);
684+
}
679685
//string obj = "";
680686
//foreach (var part in ce.Attributes)
681687
//{
@@ -753,8 +759,8 @@ private static void AddImageHandlers(string siteName)
753759
{
754760
MessageBox.Show("jpegHandlerMissing ex is : " + ex.Message + "stacktrace : " + ex.StackTrace);
755761
}
756-
}
757-
762+
}
763+
758764
serverManager.CommitChanges();
759765
}
760766
}

0 commit comments

Comments
 (0)