Skip to main content
.NET Framework Class Library
WeakReferenceIsAlive Property

Gets an indication whether the object referenced by the current WeakReference object has been garbage collected.

Namespace:   System
Assembly:  mscorlib (in mscorlib.dll)
Syntax
Public Overridable ReadOnly Property IsAlive As [%$TOPIC/4a2wx9sd_en-us_VS_110_2_0_0_0_0%]
public virtual [%$TOPIC/4a2wx9sd_en-us_VS_110_2_0_1_0_0%] IsAlive { get; }
public:
virtual property [%$TOPIC/4a2wx9sd_en-us_VS_110_2_0_2_0_0%] IsAlive {
	[%$TOPIC/4a2wx9sd_en-us_VS_110_2_0_2_0_1%] get ();
}
abstract IsAlive : [%$TOPIC/4a2wx9sd_en-us_VS_110_2_0_3_0_0%] with get 
override IsAlive : [%$TOPIC/4a2wx9sd_en-us_VS_110_2_0_3_0_1%] with get

Property Value

Type: SystemBoolean
true if the object referenced by the current WeakReference object has not been garbage collected and is still accessible; otherwise, false.
Remarks

Because an object could potentially be reclaimed for garbage collection immediately after the IsAlive property returns true, using this property is not recommended unless you are testing only for a false return value.

Version Information

.NET Framework

Supported in: 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Portable Class Library

Supported in: Portable Class Library

.NET for Windows Store apps

Supported in: Windows 8
Platforms

Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.