[Mono-dev] Installing pre-load hooks on windows(bug?)

Thiago Padilha tpadilha84 at gmail.com
Wed Jun 16 19:13:34 EDT 2010


  I use a callback function to control assembly loading with this code :


MonoAssembly *pre_hook(MonoAssemblyName *aname, gchar
**assemblies_path, gpointer user_data)
{	
	char *name = aname->name;
	printf("\nTRYING TO LOAD ASSEMBLY : %s\n", name);		
	return get_assembly_from_name(name, assemblydir,
&lastloadstatus);//custom logic for finding an assembly
}

int main(int argc, char** argv)
{	
	//installing the pre-load hook	
	mono_install_assembly_preload_hook(pre_hook, "some data");
		
	//starting the domain
	MonoDomain *domain = mono_jit_init_version("Host", "v2.0.50727");	
	
	MonoAssemblyName *aname = malloc(sizeof(MonoAssemblyName));
	aname->name = "App.exe";
	MonoAssembly *mainassembly = mono_assembly_load(aname, "/", &lastloadstatus);
		
	return mono_jit_exec(domain, mainassembly, argc, argv);
}

  All works correctly, except that when I run this program on
Windows(I have tested on both Seven and XP) get the following 'extra'
output

TRYING TO LOAD ASSEMBLY : I18N

  I have no idea where this 'I18N' comes from. This is not stopping
the program to run, all I had is to validade my custom logic against
this 'I18N' assembly, but I wonder where does this comes from(the
runtime tried to load this assembly two times).


More information about the Mono-devel-list mailing list