PostSharp 6.9 / / Post­Sharp Documentation / API Reference / Post­Sharp.​Aspects.​Advices Namespace / On­Method­Invoke­Base­Advice Class / On­Method­Invoke­Base­Advice Properties / On­Method­Invoke­Base­Advice.​Unsupported­Target­Action Property

OnMethodInvokeBaseAdvice.UnsupportedTargetAction Property

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

Namespace:  PostSharp.Aspects.Advices
Assembly:  PostSharp (in PostSharp.dll) Version: 6.9.1.0 (6.9.1.0)
Syntax
C#
public UnsupportedTargetAction UnsupportedTargetAction { get; set; }

Property Value

Type: UnsupportedTargetAction
Remarks

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