Unloading and reloading modules in ModuleManager

I need to unload a dll from the modulemanager to allow it to be updated, then reload the dll once the file has been updated. When I do this the module is re-loaded but it reloads the old version of the dll. Is this because the modulemanager has cached the dll? If so is it possible to clear this cache and force the file to be reloaded?
If the file isn’t cached, why would it not load the new file?
Thanks

Hi,

Can you specify what platform(s) are you using for host and plugins?

known issue:

  • You can’t correctly unload visual Delphi FMX plugin because the External exception 87A exception is raised in dxgi.dll when fmx.FMX.Forms.FinalizeForms is called.

Hi Evgeny,
I’m using .net as the host and plugin, both in Oxygene.
Visual Studio 2019
Oxygene 10.0.0.2891
Hydra 6.6.0.1317
Thanks

Hi,

Have you set inNewAppDomain when you load plugins ?

I’ve changed the LoadModule to set inNewAppDomain to true, when I do this I get an error 'Could not load type ‘some.type’ from assembly ‘my assembly, version=1.0.0.0, Culture=neutral, PublicKeyToken=null’.
With inNewAppDomain=false the plugins load successfully but I can’t unload and reload them.
Thanks

Hi,

can you create a simple testcase that reproduces this error, pls?
You can drop it to support@ for keeping privacy…

I’ve created a stripped version of my host and plugin applications to send you but the loadmodule now works. I’m going start adding code back in to see at which point the error returns, at which point I should either have an idea as to what is causing the issue, or an application I can send to you.
Thanks.