[Mono-dev] C# code works with "mono", not with mono embedding

Paolo Molaro lupus at ximian.com
Thu Mar 9 09:16:15 EST 2006


On 03/09/06 Jean Carrive wrote:
> 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
> wonder if this could be due to a dotnet version problem (1.0 and 2.0).
>  
> See below for the error messages.
[...]
> ** (process:13101): WARNING **: The class
> System.Collections.Generic.Dictionary`2 could not be loaded, used in
> mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

Currently the use of 2.0 features is not directly exposed in all the
embedding APIs.
Until we do, I suggest you call mono_jit_init() passing the filename of
an assembly compiled with gmcs (so a 2.0 assembly): this will cause the
runtime to initialize in 2.0 mode. The Main() of this assembly can just
be empty.

lupus

-- 
-----------------------------------------------------------------
lupus at debian.org                                     debian/rules
lupus at ximian.com                             Monkeys do it better



More information about the Mono-devel-list mailing list