[Mono-dev] Invoking .net interface method from c api

Robert Jordan robertj at gmx.net
Fri Aug 21 08:56:10 UTC 2015


On 21.08.2015 06:44, zebrajap wrote:
> Now I am getting a different error.
>
> 104		MonoObject* pIcc = mono_runtime_invoke(pMethodCreateCompiler,
> pCodeProvider, NULL, NULL);
> (gdb) p pMethodCreateCompiler
> $1 = (MonoMethod *) 0x6aa288
> (gdb) n
>
> Unhandled Exception:
> System.InvalidProgramException: Invalid IL code in
> Microsoft.CSharp.CSharpCodeProvider:CreateCompiler (): IL_0000: ret
>
> [ERROR] FATAL UNHANDLED EXCEPTION: System.InvalidProgramException: Invalid
> IL code in Microsoft.CSharp.CSharpCodeProvider:CreateCompiler (): IL_0000:
> ret
>
> So I opened mono/4.0/System.dll using ILSpy. There, all the methods seems to
> have empty body with single instruction.
> <http://mono.1490590.n4.nabble.com/file/n4666512/IlSpy.png>
>
> What could be the issue ?


It looks like you are tying to execute a reference assembly.
These are stripped off of method bodies.

How do you load System.dll?

Robert




More information about the Mono-devel-list mailing list