@@ -661,40 +661,42 @@ private static void AddImageHandlers(string siteName)
661661 bool jpegHandlerMissing = true ;
662662 ConfigurationElement toRemoveCe = null ;
663663
664- // List<ConfigurationElement> toRemoveElements = new List<ConfigurationElement>();
664+ List < ConfigurationElement > toRemoveElements = new List < ConfigurationElement > ( ) ;
665665
666666 foreach ( ConfigurationElement ce in handlersCollection )
667667 {
668- if ( ce . GetAttributeValue ( "name" ) . ToString ( ) == "get-image-png" )
669- {
670- //MessageBox.Show("pngHandlerMissing");
671- pngHandlerMissing = false ;
672- }
673- if ( ce . GetAttributeValue ( "name" ) . ToString ( ) == "get-image-jpg" )
674- {
675- //MessageBox.Show("jpgHandlerMissing");
676- jpgHandlerMissing = false ;
677- }
678- if ( ce . GetAttributeValue ( "name" ) . ToString ( ) == "get-image-jpeg" )
679- {
680- //MessageBox.Show("jpegHandlerMissing");
681- jpegHandlerMissing = false ;
682- }
668+ //if (ce.GetAttributeValue("name").ToString() == "get-image-png")
669+ //{
670+ // //MessageBox.Show("pngHandlerMissing");
671+ // pngHandlerMissing = false;
672+ //}
673+ //if (ce.GetAttributeValue("name").ToString() == "get-image-jpg")
674+ //{
675+ // //MessageBox.Show("jpgHandlerMissing");
676+ // jpgHandlerMissing = false;
677+ //}
678+ //if (ce.GetAttributeValue("name").ToString() == "get-image-jpeg")
679+ //{
680+ // //MessageBox.Show("jpegHandlerMissing");
681+ // jpegHandlerMissing = false;
682+ //}
683+
684+ //if (ce.GetAttributeValue("name").ToString() == "ExtensionlessUrlHandler-Integrated-4.0")
685+ //{
686+ // toRemoveCe = ce;
687+ //}
688+ toRemoveElements . Add ( ce ) ;
683689
684- if ( ce . GetAttributeValue ( "name" ) . ToString ( ) == "ExtensionlessUrlHandler-Integrated-4.0" )
685- {
686- toRemoveCe = ce ;
687- }
688690 }
689- try
690- {
691- if ( toRemoveCe != null )
692- handlersCollection . Remove ( toRemoveCe ) ;
693- } catch { }
694- //foreach (ConfigurationElement ce in toRemoveElements)
691+ //try
695692 //{
696- // handlersCollection.Remove(ce);
697- //}
693+ // if (toRemoveCe != null)
694+ // handlersCollection.Remove(toRemoveCe);
695+ //} catch { }
696+ foreach ( ConfigurationElement ce in toRemoveElements )
697+ {
698+ handlersCollection . Remove ( ce ) ;
699+ }
698700 //handlersCollection.Clear();
699701
700702
0 commit comments