[Mono-list] mono_jit_exec problem

Fede federico.omoto at gmail.com
Sun Nov 14 11:07:22 EST 2010


Robert:

The source is very simple, I execute it like this:
http://pastebin.com/cnHFiYY4
If you take a look at the mono command line program debug output you'll
notice that it is the same of my program: http://pastebin.com/F7SEeP57

Here's the source code and again, best regards and thank you very much!

Federico Omoto


#include <mono/jit/jit.h>
#include <mono/metadata/object.h>
#include <mono/metadata/environment.h>
#include <mono/metadata/assembly.h>
#include <mono/metadata/debug-helpers.h>
#include <string.h>
#include <stdlib.h>

int main(int argc, char* argv[])
{
        MonoDomain *domain;
        MonoAssembly *assembly;
        int returnValue;

        if (argc < 2) {
                fprintf(stderr, "Please provide an assembly to run\n");
                return 1;
        }

        if (setenv("MONO_PATH",
"/home/fede/Downloads/Axiom-0.8.0.0-B2/samples/mono", 1)) {
                fprintf(stderr, "Can't add MONO_PATH variable name to the
environment\n");
                return 2;
        }

        domain = mono_jit_init_version(argv[0], "v2.0.50727");

        assembly = mono_domain_assembly_open(domain, argv[1]);
        if (!assembly) {
                fprintf(stderr, "Can't load assembly %s\n", argv[1]);
                return 3;
        }

        mono_jit_exec(domain, assembly, argc - 1, argv + 1);
        returnValue = mono_environment_exitcode_get();
        mono_jit_cleanup(domain);

        return returnValue;
}



On Sun, Nov 14, 2010 at 10:23 AM, Robert Jordan <robertj at gmx.net> wrote:

> Federico,
>
> On 14.11.2010 01:23, Fede wrote:
> > Robert:
> >
> > Thank you very much for your answer!
> > I tried setting the MONO_PATH environment variable to where the
> assemblies
> > are located and the mono command line program seems to do the same, it
> > doesn't run the main assembly.
> >
> > The debug output shows that all referenced assemblies are loaded OK:
> > http://pastebin.com/wu1KWYUU
> >
> > Is there something else I could try?
>
> Please post your source code around mono_jit_exec's invocation.
>
> Robert
>
> _______________________________________________
> Mono-list maillist  -  Mono-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20101114/0312dc09/attachment.html 


More information about the Mono-list mailing list