Unload Method

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Unloads the specified application domain.

Namespace:  System
Assembly:  mscorlib (in mscorlib.dll)

static member Unload : 
        domain:AppDomain -> unit 

Parameters

domain
Type: System..::..AppDomain
An application domain to unload.

ExceptionCondition
ArgumentNullException

domain is nullNothingnullptrunita null reference (Nothing in Visual Basic).

CannotUnloadAppDomainException

domain could not be unloaded.

Exception

An error occurred during the unload process.

NoteNote

In some cases, calling Unload causes an immediate CannotUnloadAppDomainException, for example if it is called in a finalizer.

The threads in domain are terminated using the Abort method, which throws a ThreadAbortException in the thread. Although the thread should terminate promptly, it can continue executing for an unpredictable amount of time in a finally clause.

Show: