all groups > dotnet clr > august 2004 >
You're in the

dotnet clr

group:

Unload assembly


Unload assembly Xavi Sam
8/27/2004 8:42:40 AM
dotnet clr:
Hi

I know how to load a assembly form specified directory, using
Assembly.LoadFrom but How can I unload it? Is there something similar to
FreeLibrary?

Thanks in advance

Javier

Re: Unload assembly Stefano \
8/27/2004 8:51:57 AM
[quoted text, click to view]

As far as I know, you cannot unload an assembly. The recommended way is to
load you dynamic assemblies in a separate appdomain, and tear down the whole
appdomain when you need to unload the assemblies.
--
WildHeart'2k4

Re: Unload assembly ESCOFFIER_Clément
8/27/2004 10:52:46 AM
A solution not sure to unload an assembly is to create a second
appdomain who list the loaded assemblies. When you want to unload an
assembly, you remove this assembly of the list ( stored in the second
appdomain ), then you delete the first appdomain, and you create the
first appdomain with all assemblies listed. This solution is dangerous
when you have links between assemblies, and you lost your execution
context. But it is the only solution, to unload One assembly.

Clément


[quoted text, click to view]
Re: Unload assembly Shiva
8/27/2004 12:32:19 PM
Hi,
Assemblies cannot be unloaded. You have to load them in a separate app
domain and unload that app domain when assemblies have to be unloaded.

[quoted text, click to view]
Hi

I know how to load a assembly form specified directory, using
Assembly.LoadFrom but How can I unload it? Is there something similar to
FreeLibrary?

Thanks in advance

Javier


AddThis Social Bookmark Button