[Mono-dev] embedded mono and .NET 4.0 assemblies [peculiar error]

Jonathan Shore jonathan.shore at gmail.com
Fri Nov 4 15:22:58 EDT 2011


I'm working off of http://www.mono-project.com/Embedding_Mono with regard to initialization.   I tried a number of possible version #s for the mono_jit_init_version(), but indicated:

WARNING: The runtime version supported by this application is unavailable.
Using default runtime: v2.0.50727

what is the version # one should use to correspond to .NET 4?   The version #s like v2.0.50727 are peculiar (but I think a MS thing).   Or is there a way to initialize the domain using the assembly?  Is the argument to the domain optionally either its name or the path to the main assembly?   I note that in the header have the signature:

    mono_jit_init (const char *file);

Whereas the documentation in the link above indicates that mono_jit_init () is provided with the name for the domain.

I guess the docs are not very clear here.  Just need one approach that works.  Thanks for your help.


On Nov 4, 2011, at 3:13 PM, Robert Jordan wrote:

> On 04.11.2011 20:05, Jonathan Shore wrote:
>> My assembly is definitely 4.0 and "monodis --assemblyref" indicates dependency on .NET 4 assemblies.   I'll look into mono_jit_init_version() and see whether this helps.
> 
> Yes, but you're not using it for initialization.
> 
>> 
>> 	// create AppDomain
> 
> This won't initialize a v4 runtime. The default is 2.0:
> 
>> 	_domain = mono_jit_init ("api");
>> 	
>> 	// load bootstrap assembly
>> 	string dir (assemblydir);
>> 	string path = dir + "/com.gf.core.dll";
> 
> That's too late:
> 
>> 	_core = mono_domain_assembly_open (_domain, path.c_str());
>> 
>> Where "com.gf.core.dll" is compiled to .NET 4.0.  Thanks
> 
> Robert
> 
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20111104/4f703a87/attachment.html 


More information about the Mono-devel-list mailing list