Support for unloading Application Domains

Application domains are created and run inside a process, and provide a unit of isolation for the common language runtime. For most applications, you do not need to create your own application domain. However, if you create an application that hosts the common language runtime, create tools or code that you want to unload programmatically, or create pluggable components that can be unloaded and reloaded on the fly, you do need to create your own application domains.

With the .NET Framework 2.0, you can unload application domains that are not needed.

When you are finished using an application domain, unload it by using the System.AppDomain.Unload method. The Unload method shuts down the specified application domain. During the unloading process, no new threads can access the application domain and all application domain–specific data structures are freed. Assemblies loaded into the application domain are removed and are no longer available. If an assembly in the application domain is domain-neutral, data for the assembly remains in memory until the entire process is shut down.