Share via


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)

Syntax

'Declaration
Public Shared Sub Unload ( _
    ___domain As AppDomain _
)
public static void Unload(
    AppDomain ___domain
)
public:
static void Unload(
    AppDomain^ ___domain
)
static member Unload : 
        ___domain:AppDomain -> unit 
public static function Unload(
    ___domain : AppDomain
)

Parameters

Exceptions

Exception Condition
ArgumentNullException

___domain is null Nothing nullptr unit a null reference (Nothing in Visual Basic) .

CannotUnloadAppDomainException

___domain could not be unloaded.

Exception

An error occurred during the unload process.

Remarks

Note

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.

.NET Framework Security

See Also

Reference

AppDomain Class

System Namespace