[Mono-list] ICodeCompiler.CompileAssemblyFromSourceBatch failure

Robert Jordan robertj at gmx.net
Wed Jun 18 03:48:14 EDT 2008


Carl Cerecke wrote:
> Hi,
> 
> I have an unusual failure when calling
> ICodeCompiler.CompileAssemblyFromSourceBatch. The compile works
> correctly when called from a mono .exe, but does not when the same
> .exe is called via the mono embedded calls.
> 
> This works on the command-line:
>> mono mtest.exe
> 
> This code (using mono embedded libs) fails (never gets to printf):
> int main(int argc, char *argv[]) {
> 
>     domain = mono_jit_init("mtest.exe");

You must call this after mono_jit_init ():

mono_config_parse (NULL);

>     assembly = mono_domain_assembly_open (domain, "mtest.exe");
>     mono_jit_exec(domain, assembly, argc, argv);
>     printf("Ran mtest.exe\n");
> 

Robert



More information about the Mono-list mailing list