Post­Sharp Documentation / API Reference / Post­Sharp.​Aspects Namespace / Method­Execution­Args Class / Method­Execution­Args Properties / Method­Execution­Args.​Method Property

MethodExecutionArgs.Method Property

Gets the method being executed.

Namespace:  PostSharp.Aspects
Assembly:  PostSharp (in PostSharp.dll) Version: 6.1.3.0 (6.1.3.0)
Syntax
C#
public MethodBase Method { get; set; }

Property Value

Type: MethodBase
Remarks

If the executed method is generic or if its declaring type is generic, the current property contains the generic instance being executed.

Note Note
Using this property causes the aspect weaver to generate code that has non-trivial runtime overhead. Avoid using this property whenever possible. One of the possible solution is to use compile-time initialization of aspect instances and to make use of reflection only at build time. See CompileTimeInitialize(MethodBase, AspectInfo) for details.
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