2008-09-12 Zoltan Varga <vargaz@gmail.com>

* 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
This commit is contained in:
Zoltan Varga 2008-09-12 20:07:13 +00:00
parent cbf6068edf
commit fc871aacca
2 changed files with 16 additions and 7 deletions

View file

@ -1,3 +1,8 @@
2008-09-12 Zoltan Varga <vargaz@gmail.com>
* 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 <mgorse@novell.com>
* atk/Object.custom, atk/glue/object.c: Support GetIndexInParent.

View file

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