// Unload a specific application domain. public static void Unload(AppDomain domain) { if (domain == null) { throw new ArgumentNullException("domain"); } // We must not unload the default AppDomain if (IsDefaultAppDomainInternal(domain.appDomain)) { throw new CannotUnloadAppDomainException(); } if (domain.DomainUnload != null) { domain.DomainUnload(domain, new EventArgs()); } UnloadAppDomain(domain.appDomain); }