[Mono-dev] Embedding Mono

vinay_rk vinay.kashyap at ironmountain.com
Thu Mar 10 02:26:29 EST 2011


Hi,

I' am trying to Embed Mono with C/C++ and so far I've been able to compile
and link my c++ project with the required Mono headers and lib.  My code
looks something like this:

MonoDomain *domain;
	MonoAssembly *assembly;
	 
    domain = mono_jit_init ("system");
	assembly = mono_domain_assembly_open (domain, "TestManagedAssembly.exe");
	if (!assembly)
		printf("Error");
	else
	{
		mono_jit_exec (domain, assembly,0, NULL);
	}

while the call to mono_jit_init seems to return a valid looking pointer, the
call to mono_domain_assembly_open always returns a NULL pointer. The managed
assembly I' am trying to load (TestManagedAssembly.exe) is a single line
console app which just prints out a console statement. It does not have any
dependencies. Whereas if I try loading something like "mscorlib" things seem
to work fine. But any other assemblies that I have fail to load. Can anyone
help me with the possible reasons for this ?

Regards
-Vinay

--
View this message in context: http://mono.1490590.n4.nabble.com/Embedding-Mono-tp3345310p3345310.html
Sent from the Mono - Dev mailing list archive at Nabble.com.


More information about the Mono-devel-list mailing list