PostSharpAPI ReferencePost­Sharp.​AspectsMethod­Interception­ArgsMethod
Open sandboxFocus

MethodInterceptionArgs.Method Property


Gets the method being executed.

public MethodBase Method { get; set; }
Property Value
Type Description

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


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.


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

See Also