mscorlib 4.0.0.0 System.Runtime.CompilerServices.StateMachineAttribute System.AttributeUsage(System.AttributeTargets.Method, Inherited=false)

You shouldn't apply the AsyncStateMachine attribute to methods in your code. For methods that have the async modifier, the compiler will apply the AsyncStateMachine attribute in the IL that the compiler emits.

When a method (MethodName) has the Async or async modifier, the compiler emits IL that includes a state machine structure. This structure contains the code in the method. That IL also contains a stub method (MethodName) that calls into the state machine. The compiler adds the AsyncStateMachine attribute to the stub method so that tools can identify the corresponding state machine. Details of the emitted IL might change in future releases of the compilers.

For information about the Async feature, see Asynchronous Programming with Async and Await (C# and Visual Basic).

Indicates whether a method is marked with either the Async (Visual Basic) or async (C# Reference) modifier.

- Constructor
  4.0.0.0
  To be added.

  Initializes a new instance of the class.

  The type object for the underlying state machine type that's used to implement a state machine method.