How Do I Unload An Application Domain?

user image

Muskan Anand

2 years ago

You should use the following static method in the System.AppDomain class: public static void Unload(AppDomain domain) The Unload method gracefully shuts down the specified application domain. During shutdown no new threads are allowed to enter the application domain and all application domain specific data structures are freed. You cannot unload an application domain in a finalizer or destructor. If the application domain has run code from a domain-neutral assembly, the domains copy of the statics and related CLR data structures are freed, but the code for the domain-neutral assembly remains until the process is shutdown. There is no mechanism to fully unload a domain-neutral assembly other than shutting down the process.

Recent Doubts

Close [x]