+2004-05-11 Zoltan Varga <vargaz@freemail.hu>
+
+ * reflection.c (mono_reflection_get_type): Lookup the type in all
+ modules of a multi-module assembly. Fixes #58291.
+
2004-05-11 Lluis Sanchez Gual <lluis@ximian.com>
* threads.c: Before aborting a background, set the StopRequested state (this
assembly =
mono_domain_try_type_resolve (
mono_domain_get (), fullName->str, NULL);
- if (assembly && (!image || (assembly->assembly->image == image)))
- type = mono_reflection_get_type_internal (assembly->assembly->image,
- info, ignorecase);
+ if (assembly && (!image || (assembly->assembly->image == image))) {
+
+ if (assembly->assembly->dynamic) {
+ /* Enumerate all modules */
+ MonoReflectionAssemblyBuilder *abuilder = (MonoReflectionAssemblyBuilder*)assembly;
+ int i;
+
+ type = NULL;
+ if (abuilder->modules) {
+ for (i = 0; i < mono_array_length (abuilder->modules); ++i) {
+ MonoReflectionModuleBuilder *mb = mono_array_get (abuilder->modules, MonoReflectionModuleBuilder*, i);
+ type = mono_reflection_get_type_internal (&mb->dynamic_image->image, info, ignorecase);
+ if (type)
+ break;
+ }
+ }
+
+ if (!type && abuilder->loaded_modules) {
+ for (i = 0; i < mono_array_length (abuilder->loaded_modules); ++i) {
+ MonoReflectionModule *mod = mono_array_get (abuilder->loaded_modules, MonoReflectionModule*, i);
+ type = mono_reflection_get_type_internal (mod->image, info, ignorecase);
+ if (type)
+ break;
+ }
+ }
+ }
+ else
+ type = mono_reflection_get_type_internal (assembly->assembly->image,
+ info, ignorecase);
+ }
g_string_free (fullName, TRUE);
return type;
}