Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

Unloading Domains and Shutting Down a Process 

Application domains can be unloaded without stopping the entire process. Hosts can take advantage of this feature to unload code that is no longer needed, thereby reducing memory use and increasing the scalability of their application.

The System.AppDomain class includes a static method called Unload that hosts can use to unload a particular application domain. AppDomain.Unload performs a graceful shutdown, not unloading the application domain until there are no more active threads.

Assemblies that have been loaded into the default application domain or assemblies that have been loaded as application domain-neutral cannot be unloaded without shutting down the entire process.

The ICLRRuntimeHost::Stop method can be used to disable the common language runtime in a process. After ICLRRuntimeHost::Stop has been called on a process, the runtime cannot be restarted in that process. ICLRRuntimeHost::Stop must be called once for each time ICLRRuntimeHost::Start has been called.


The ICLRRuntimeHost interface is new in the .NET Framework version 2.0. In versions 1.0 and 1.1, use the ICorRuntimeHost::Stop method to disable the runtime.

See Also

Community Additions

© 2015 Microsoft