2009-09-15 Marek Habersack <mhabersack@novell.com>
[mono.git] / mcs / class / System.Web / System.Web.UI / TemplateParser.cs
index 01ddaec09d5117bc440fe38e994c2ddcc3164a2f..4c8f97a2511880c340a8448d50c144ff958b8739 100644 (file)
@@ -620,7 +620,16 @@ namespace System.Web.UI {
 
                bool FindNamespaceInAssembly (Assembly asm, string namesp)
                {
-                       foreach (Type type in asm.GetTypes ()) {
+                       Type[] asmTypes;
+
+                       try {
+                               asmTypes = asm.GetTypes ();
+                       } catch (ReflectionTypeLoadException) {
+                               // ignore
+                               return false;
+                       }
+                       
+                       foreach (Type type in asmTypes) {
                                if (String.Compare (type.Namespace, namesp, StringComparison.Ordinal) == 0) {
                                        namespacesCache.Add (namesp, true);
                                        AddAssembly (asm, true);