From fc871aaccadcfe1496965165dd1fffbd94ae478e Mon Sep 17 00:00:00 2001 From: Zoltan Varga Date: Fri, 12 Sep 2008 20:07:13 +0000 Subject: [PATCH] 2008-09-12 Zoltan Varga * glib/GType.cs (FindTypeInReferences): Put a try-catch around the assembly loading as failure to load a referenced assembly is not really an error. svn path=/trunk/gtk-sharp/; revision=112905 --- ChangeLog | 5 +++++ glib/GType.cs | 18 +++++++++++------- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8eda79b58..ed9c04fc3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-09-12 Zoltan Varga + + * glib/GType.cs (FindTypeInReferences): Put a try-catch around the assembly + loading as failure to load a referenced assembly is not really an error. + 2008-09-12 Mike Gorse * atk/Object.custom, atk/glue/object.c: Support GetIndexInParent. diff --git a/glib/GType.cs b/glib/GType.cs index 1d59da477..5a2001c12 100755 --- a/glib/GType.cs +++ b/glib/GType.cs @@ -166,13 +166,17 @@ namespace GLib { string asm_dir = Path.GetDirectoryName (asm.Location); foreach (AssemblyName ref_name in asm.GetReferencedAssemblies ()) { Assembly ref_asm; - if (File.Exists (Path.Combine (asm_dir, ref_name.Name + ".dll"))) - ref_asm = Assembly.LoadFrom (Path.Combine (asm_dir, ref_name.Name + ".dll")); - else - ref_asm = Assembly.Load (ref_name); - result = FindTypeInReferences (type_name, ref_asm, visited); - if (result != null) - break; + try { + if (File.Exists (Path.Combine (asm_dir, ref_name.Name + ".dll"))) + ref_asm = Assembly.LoadFrom (Path.Combine (asm_dir, ref_name.Name + ".dll")); + else + ref_asm = Assembly.Load (ref_name); + result = FindTypeInReferences (type_name, ref_asm, visited); + if (result != null) + break; + } catch (Exception) { + /* Failure to load a referenced assembly is not an error */ + } } } return result;