Hi all,
I'm developing a tool that explores contents of
assemblies via reflection. When the tool is requested to
get some information from an assembly, it loads the
assembly and reads the information. I would like unload
the assembly immediately after to prevent it from locking
and give the client a possibility to update it. Is there
any way to do this? System.Assembly class has no Unload
method, so I create separate application domain and load
the assembly in this domain. Then I unload the entire
domain by AppDomain.Unload call. However it seems that
the loaded assemblies are still locked even after
unloading the domain.

Has anybody ideas about the reasons of such behavior? Or
can anyone suggest other ways to solve the problem?

Thanks,
Dmitry Shaporenkov

Re: Unloading assemblies by Dave

Dave
Mon Jun 30 05:14:38 CDT 2003

Make sure that you are doing all the reflection work in the other appdomain.
If you return references to types or assemblies from the other appdomain to
the default appdomain this has the effect of loading the assembly into both
appdomains.

"Dmitry Shaporenkov" <dsha1980@yahoo.com> wrote in message
news:07b701c33eed$e967a180$a101280a@phx.gbl...
> Hi all,
> I'm developing a tool that explores contents of
> assemblies via reflection. When the tool is requested to
> get some information from an assembly, it loads the
> assembly and reads the information. I would like unload
> the assembly immediately after to prevent it from locking
> and give the client a possibility to update it. Is there
> any way to do this? System.Assembly class has no Unload
> method, so I create separate application domain and load
> the assembly in this domain. Then I unload the entire
> domain by AppDomain.Unload call. However it seems that
> the loaded assemblies are still locked even after
> unloading the domain.
>
> Has anybody ideas about the reasons of such behavior? Or
> can anyone suggest other ways to solve the problem?
>
> Thanks,
> Dmitry Shaporenkov
>
>