[Mono-dev] Re: Problem: command line works, calling from C doesn't

Robert Jordan robertj at gmx.net
Thu Mar 9 07:43:03 EST 2006


Hey,

Jean Carrive wrote:
>  
>     Hello,
>  
> I have some C# code doing various things (dotnet remoting, in particular).
> This code works fine if it is in a ".exe" file and if it is called with the
> "mono" command. On the other hand, it does'nt work if it is in a ".dll" file
> and if it is called from a "C" program with "Mono Embedding" facilities. I

Please define "does not work", preferably with a stack trace and/or
error message and the mono version.

If the error message reads approximately "cannot load mscorlib", then
your C app doesn't call mono_set_dirs (). Try this:

mono_set_dirs ("/usr/lib", "/usr/etc");

This assumes that mono's installation prefix is "/usr".

> wonder if this could be because I have several versions of mono on my
> machine. For, I have two directories "/usr/lib/mono/1.0" and
> "/usr/lib/mono/2.0". When I make a symbolic link from 1.0 to 2.0 in order to
> call what I suppose are the "good" libraries, it solves some problems but
> not all of them ?

/usr/lib/mono/2.0 contains the assemblies of the 2.0 profile. This
is not just another mono version. It belongs to the same installation.

If you really have several monos on your machine, then make sure
that the correct paths are passed to mono_set_dirs ().

Robert




More information about the Mono-devel-list mailing list