[Mono-dev] Embedding Mono

Robert Jordan robertj at gmx.net
Wed Jun 9 18:20:49 EDT 2010

On 09.06.2010 23:14, Thiago Padilha wrote:
>   Hi Jonathan,
>   I'm also working with an embedded mono application, do you know if I
> can have full control on the assembly loader for mono? So far I only
> found a way to specify the probing directory, but what I really need
> is to instrument assemblies on demand, and that can only be done if I
> control the loading process.

Look at metadata/assembly.h:

/* Installs a function which is called before a new assembly is loaded
  * The hook are invoked from last hooked to first. If any of them returns
  * a non-null value, that will be the value returned in 
mono_assembly_load */
typedef MonoAssembly * (*MonoAssemblyPreLoadFunc) (MonoAssemblyName *aname,
						   gchar **assemblies_path,
						   gpointer user_data);

void          mono_install_assembly_preload_hook 
(MonoAssemblyPreLoadFunc func,
						  gpointer user_data);
void          mono_install_assembly_refonly_preload_hook 
(MonoAssemblyPreLoadFunc func,
						  gpointer user_data);


More information about the Mono-devel-list mailing list