[Mono-list] mono_jit_exec problem

Robert Jordan robertj at gmx.net
Sat Nov 13 13:25:04 EST 2010


On 13.11.2010 18:10, Fede wrote:
> That is for example: if I call it with "path/to/myassembly.exe" or
> "/full/path/to/myassembly.exe", mono_jit_exec() just returns without
> executing the program; in the other hand, if I call it being in the same
> directory where the assembly is located the program just runs fine.
>
> I've also tried using the mono command line program to see what happens in
> this situation and verified the same behaviour, so I assume it's not my code
> fault.

This is not a bug. It's by design. Even an embedded Mono is bound
to the .NET assembly binding rules.

> Do I have to do something to run an assembly that is not located in the same
> path of my application?

Yes. There are plenty of options for changing the binding rules:

- reconsider changing the rules because they make sense
- MONO_PATH (see Mono's man page)
- App.config's <assemblyBinding> (see MSDN)
- assembly load hooks (see include/mono-x.x/metadata/assembly.h,
   mono_install_assembly_preload_hook and friends).

Robert



More information about the Mono-list mailing list