@@ -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