PostSharp 5.0 / / Post­Sharp Documentation / API Reference / Post­Sharp.​Aspects.​Configuration Namespace / Method­Interception­Aspect­Configuration Class / Method­Interception­Aspect­Configuration Properties / Method­Interception­Aspect­Configuration.​Unsupported­Target­Action Property

MethodInterceptionAspectConfiguration.UnsupportedTargetAction Property

Specifies the action to take when the aspect is applied to an async method with unsupported return value type.

Namespace:  PostSharp.Aspects.Configuration
Assembly:  PostSharp (in PostSharp.dll) Version: (
public Nullable<UnsupportedTargetAction> UnsupportedTargetAction { get; set; }

Property Value

Type: Nullable<UnsupportedTargetAction>

Starting with C#7 async methods can have return types other than Task or Task<TResult>. Async method interception does not support this type of async methods. By default, the build error is raised whenever async method interception is applied to a method that returns awaitable type other than Task or Task<TResult>.

Set this property to change how unsupported async methods are handled during compile time.

See Also