The Unload method shuts down an Application Domain. The
Garbage Collector does a full garbage collection when it unloads an App Domain,
so the resources that have been used in an App Domain should be reclaimed when
it is unloaded. The following static method of the System.AppDomain class is
used to unload an Application Domain.
Listing 7
public static void Unload(AppDomain domain)
This method accepts an AppDomain object that represents the
Application Domain to be unloaded. Note that if the thread on which the Unload
method is called is executing in the domain to be unloaded, another thread is
started with a view to perform this unload operation.