[Mono-list] Embedding two assemblies in Mono gives emits NullPointerException

Robert Jordan robertj at gmx.net
Mon Sep 13 07:49:05 EDT 2010


On 13.09.2010 13:28, petermonsson wrote:
>
> Hi all,
>
> I'm trying to embed two different assemblies into my mono application.
> Embedding just either of them is no problem, but when I try to embed both, I
> get a NullPointerException.

I fail to see where you "embed" 2 assemblies. Do you mean
loading 2 assemblies and executing code from them?

>      // Init a singleton object
>      ex->obj_b = mono_object_new(ex->domain, ex->klass_b); // Allocate
> storage

Storing a MonoObject* outside the GC-controlled memory area is
a serious bug. You want to store a GC handle of the object
in place of the object itself. See mono's mono_gchandle_* APIs.

Robert



More information about the Mono-list mailing list