This documentation is archived and is not being maintained.

WeakReference.IsAlive Property

Gets an indication whether the object referenced by this instance has been garbage collected.

[Visual Basic]
Public Overridable ReadOnly Property IsAlive As Boolean
public virtual bool IsAlive {get;}
public: __property virtual bool get_IsAlive();
public function get IsAlive() : Boolean;

Property Value

true if the object referenced by this instance has not been garbage collected and is still accessible; otherwise, false.


Exception Type Condition
InvalidOperationException The reference to the target object is invalid.


An exception is thrown if the object referenced by this instance is invalid. This can occur if there is an attempt to resurrect the referenced object after it has been finalized.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

See Also

WeakReference Class | WeakReference Members | System Namespace | GC | Object