[Mono-dev] Embedded mono: first on disk dynamic assembly stays locked, while others do not.

Robert Jordan robertj at gmx.net
Mon Aug 25 18:21:32 EDT 2008


Hi,

BaSS wrote:
>>> I'm using the mono embedding API and I'm using a construction like
>> this:
>>> 1) Setup Mono (2.0 beta or 1.9.1)
>>> 2) Load main Assembly
>>> 3) Create the script compiler object from the main assembly
>>> 4) Invoke the managed scriptcompiler with a script(string) and have
>> the assembly written to disk using a semi-random name
>>> 5) from the unmanaged side, load the assembly from disk by its name
>> mono_domain_assembly_open() into a new domain (mono_domain_create)
>>> 6) do something with the assembly (run a method)
>>> 7) use mono_domain_free() on the newly created secondary domain (from
>> step 5)
>>> 8) goto step 4 for the other scripts
>> Why are you performing 5-8 from unmanaged code? This can be done much
>> easier and less error-prone in managed code.
>>
> 
> Well, I'm having a weird problem when running code within the main assembly when calling it from the unmanaged side. When I call the same code using a test app in sharpdevelop, it works.
> The managed code that fails when executed from the API is "AppDomain.CreateDomain("sandbox");" I get a stackoverflow in the mono.dll and everything comes to a halt. (all the other code works, just the createdomain fails..)

OK, I was able reproduce this:

https://bugzilla.novell.com/show_bug.cgi?id=420197

I'd suggest you to load the generated assembly into the main appdomain
until the bug is fixed.

Robert



More information about the Mono-devel-list mailing list