Partager via


WeakReference.Target Property

Gets or sets the object (the target) referenced by the current WeakReference object.

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

Syntax

public virtual Object Target { get; set; }

Property Value

A null reference if the object referenced by the current object has been collected as garbage; otherwise, a reference to the object referenced by the current object.

Remarks

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

Version Information

Available in the .NET Micro Framework versions 2.0, 2.5, 3.0, 4.0, and 4.1.

See Also

Reference

WeakReference Class
WeakReference Members
System Namespace