Open sandboxFocus

Property IsDurable

IsDurable

Gets a value indicating whether the reference stores only a string identifier rather than holding a reference to the compilation state.

Declaration
bool IsDurable { get; }
Property Value
Type Description
bool
Remarks

Non-durable references (when IsDurable is false) are bound to a specific compilation context. They are faster to resolve because they have direct access to the underlying symbol, but they prevent that compilation from being garbage-collected as long as the reference is held in memory. References returned by ToRef() are always non-durable.

Durable references (when IsDurable is true) store only a string-based identifier. They are slower to resolve but do not hold any reference to the compilation. Call ToDurable() or ToDurableRef<T>(T) to obtain one, and prefer the IDurableRef or IDurableRef<T> type over this property when the requirement can be expressed in a signature.

A reference that is stored for longer than a single pipeline run must be durable. The design-time pipeline keeps the objects that fabrics and aspects leave behind across many compilations, so a non-durable reference held by one of them keeps a whole version of the project in memory for as long as the solution is open.

See Also