rClr icon indicating copy to clipboard operation
rClr copied to clipboard

Can't find functions to unload assembly?

Open renkun-ken opened this issue 11 years ago • 3 comments

It there a function to unload a specific assembly loaded in the environment so that the DLL file is released?

renkun-ken avatar Mar 06 '14 17:03 renkun-ken

Hi, It is not possible to unload an assembly once loaded. In order to avoid esoteric issues with type equality, rClr uses single application domain; so far as I know, it implies that loaded assemblies cannot be unloaded.

jmp75 avatar Mar 06 '14 20:03 jmp75

Thanks, @jmp75!

renkun-ken avatar Mar 07 '14 01:03 renkun-ken

My motivation is simple: I write an F# library in Visual Studio and call it via rClr in R. Once the library is loaded in R, if it cannot be unloaded somehow, the DLL will always be access-restricted, and then it becomes inconvenient to change some code in VS and compile the DLL again due to the restricted DLL access. If one assembly cannot be unloaded, is there a way to unload all loaded assemblies (rather than restart a R session) to release the access of the DLL?

If unloadAllAssemblies can be implemented, it serves my purpose.

renkun-ken avatar Mar 08 '14 01:03 renkun-ken