[Mono-list] ECall methods must be packaged into a system module.

Jonathan Pryor jonpryor at vt.edu
Tue Apr 18 06:49:51 EDT 2006


On Sun, 2006-04-16 at 21:20 +0200, Antonello Provenzano wrote:
> I created an application that emulates the GNU ReadLine library,
> entirely written in C# language, merging part of the sources of the
> Mono Console API and the project DotGNU.Terminal (you can checkout it
> at http://sourceforge.net/projects/deveelreadline).
> When I started testing it, I received an exception, wrapped by a
> TypeInitializationException, with the message "ECall methods must be
> packaged into a system module.", both under Mono and .NET.

It would help if you could attach the complete stack trace for both the
TypeInitializationException and the nested exception.

> this makes me mad about the fact the
> exception thrown is a TypeInitializationException, typically
> originated by a constructor of a type).

TypeInitializationException isn't thrown when a class instance can't be
constructed -- the actual exception generated by the constructor is
thrown in that instance.  TypeInitializationException is thrown when the
static class constructor (.cctor) generates an exception.

That seems odd in this case, since there are no static field
initializers that would generate an exception within your ReadLine type.

 - Jon




More information about the Mono-list mailing list