Hi
I have a scheduling application that runs several assemblies every 5 - 20 minutes. Assemblies to run are loaded from file
dim a as [Assembly
a = [Assembly].LoadFrom("assembly_file")
then types that implement custom interface are found and executed in a new thread. When thread is finished I call GC.Collect()
I found that, if between an assembly executions I recompile assembly, scheduling application will still execute it's previous version
How can I make sure that assembly is garbage collected and and unloaded from memory so new version will be used in the next execution
Thank
David Browne - 27 Feb 2004 15:35 GMT
> Hi,
>
[quoted text clipped - 8 lines]
>
> How can I make sure that assembly is garbage collected and and unloaded from memory so new version will be used in the next execution?
You cannot unload an assembly in an AppDomain. Once it is loaded it stays
loaded. You can create another AppDomain and load the dynamic assemblies
there. Then you can shut down that AppDomain to unload the assemblies.
This is basically how ASP.NET works.
David