On 16.02.2013 23:41, nelson wrote:
I'm trying to embed mono in a c++ executable, and mono crashes on
Assembly.GetExecutingAssembly. Any idea of what I missed ?


Some reflection methods don't work correctly if they are unable to
walk managed stack frames. When mono_runtime_invoke () is called
on such a method, no managed stack frames exist and these methods
are simply crashing.

You can work around this issue by providing helpers for these
methods:

[MethodImpl(MethodImplOptions.NoInlining)]
public static Assembly GetExecutingAssembly ()
{
        return Assembly.GetExecutingAssembly ();
}

[MethodImpl(MethodImplOptions.NoInlining)]
public static Assembly GetCallingAssembly ()
{
        return Assembly.GetCallingAssembly ();
}

You may want to file a bug, but I believe the issue is by design.

Robert


_______________________________________________
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list

Reply via email to