[Mono-dev] Embedded mono: first on disk dynamic assembly stays locked, while others do not.
robertj at gmx.net
Mon Aug 25 14:38:17 EDT 2008
> Hi Guys,
> 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.
> The problem is, the FIRST assembly written to disk stays locked and can't be overwritten nor deleted.
> Is this a bug or is there something being loaded initialized only the first time I compile the dynamic assembly?
It's most likely in your code, as a simple managed proof of concept does
not expose this bug.
More information about the Mono-devel-list