# Unloading and reloading modules in ModuleManager

**URL:** https://talk.remobjects.com/t/unloading-and-reloading-modules-in-modulemanager/29985
**Category:** Hydra
**Tags:** net
**Created:** [July 12, 2024, 9:48am UTC](https://talk.remobjects.com/t/unloading-and-reloading-modules-in-modulemanager/29985 "2024-07-12T09:48:00Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![simona](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/s/a5b964/32.png) [@simona](https://talk.remobjects.com/u/simona)
#### Post date: [July 12, 2024, 9:48am UTC](https://talk.remobjects.com/t/unloading-and-reloading-modules-in-modulemanager/29985/1 "2024-07-12T09:48:00Z")

</div>

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

---

<div class="post-metadata">

### Author: ![EvgenyK](https://talk.remobjects.com/user_avatar/talk.remobjects.com/evgenyk/32/16_2.png) [@EvgenyK](https://talk.remobjects.com/u/EvgenyK)
#### Post date: [July 15, 2024, 6:26am UTC](https://talk.remobjects.com/t/unloading-and-reloading-modules-in-modulemanager/29985/2 "2024-07-15T06:26:24Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![simona](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/s/a5b964/32.png) [@simona](https://talk.remobjects.com/u/simona)
#### Post date: [July 15, 2024, 7:01am UTC](https://talk.remobjects.com/t/unloading-and-reloading-modules-in-modulemanager/29985/3 "2024-07-15T07:01:26Z")

</div>

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

---

<div class="post-metadata">

### Author: ![EvgenyK](https://talk.remobjects.com/user_avatar/talk.remobjects.com/evgenyk/32/16_2.png) [@EvgenyK](https://talk.remobjects.com/u/EvgenyK)
#### Post date: [July 15, 2024, 7:13am UTC](https://talk.remobjects.com/t/unloading-and-reloading-modules-in-modulemanager/29985/4 "2024-07-15T07:13:42Z")

</div>

Hi,

Have you set `inNewAppDomain` when you load plugins ?

---

<div class="post-metadata">

### Author: ![simona](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/s/a5b964/32.png) [@simona](https://talk.remobjects.com/u/simona)
#### Post date: [July 16, 2024, 12:48pm UTC](https://talk.remobjects.com/t/unloading-and-reloading-modules-in-modulemanager/29985/5 "2024-07-16T12:48:00Z")

</div>

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

---

<div class="post-metadata">

### Author: ![EvgenyK](https://talk.remobjects.com/user_avatar/talk.remobjects.com/evgenyk/32/16_2.png) [@EvgenyK](https://talk.remobjects.com/u/EvgenyK)
#### Post date: [July 16, 2024, 1:19pm UTC](https://talk.remobjects.com/t/unloading-and-reloading-modules-in-modulemanager/29985/6 "2024-07-16T13:19:53Z")

</div>

Hi,

> [@simona](#):
>
> 'Could not load type ‘some.type’ from assembly ‘my assembly, version=1.0.0.0, Culture=neutral, PublicKeyToken=null’.

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

---

<div class="post-metadata">

### Author: ![simona](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/s/a5b964/32.png) [@simona](https://talk.remobjects.com/u/simona)
#### Post date: [July 17, 2024, 10:32am UTC](https://talk.remobjects.com/t/unloading-and-reloading-modules-in-modulemanager/29985/7 "2024-07-17T10:32:41Z")

</div>

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.
