PostSharp6.0/API Reference/Post­Sharp.​Aspects Namespace/Advice­Args Class/Advice­Args Properties/Advice­Args.​Instance Property

AdviceArgs.Instance Property

Gets or sets the object instance on which the method is being executed.

Namespace:  PostSharp.Aspects
Assembly:  PostSharp (in PostSharp.dll) Version: 6.1.6.0 (6.1.6.0)
Syntax
C#
public Object Instance { get; set; }

Property Value

Type: Object
Remarks

This set may be set by user code only when the instance is a value type. As usually, user code is responsible for setting an object of the right type.

Note Note
As a result of weaving optimizations, value of this property may be seen null in a debugger. If you need to inspect the value in runtime, consider disabling aspect optimizations in the debug build configuration.
See Also