[Mono-list] Embedding Mono

Andreas Färber andreas.faerber at web.de
Sat Nov 18 05:36:31 EST 2006


>> What is the correct way to initialize the Mono JIT for v2.0 without
>> using an assembly? Is this a missing feature?
> Only one mscorlib can be loaded in the runtime, so you plan on  
> using 2.0
> features, your first program must be a 2.0 program.

The program is native-only for now so I don't have a managed "first  
program" assembly that I could use for initializing. I use the  
program to initialize the JIT for use by native plug-ins which will  
all use generics in their business logic if they use managed code at  
all. Ideally the plug-ins would create their own domains but reading  
the Mono source it does not seem possible from native code currently,  
only from managed code, so I pass the initial domain on to the plug- 
ins. And this leads to the type initialization exception of the  
generic List<T> not being available. My workaround currently is to  
initialize the domain using a hello world 2.0 assembly which has  
nothing to do with my main application. So my wish would be some  
overload of mono_jit_init to tackle this, and I could provide a patch  
myself if decided how to go about it. My suggestion would be to  
rename the current mono_jit_init and mini_init and to provide a  
mono_jit_init that calls into that enhanced function with a NULL  
argument just like mono_init_... call mono_init_internal with varying  
arguments; that way compatibility with existing code would be assured  
and no code duplicated.


More information about the Mono-list mailing list