System.Runtime.InteropServices.OutAttribute Class

public sealed class OutAttribute : Attribute

Base Types







Indicates that a parameter will be marshaled from the callee back to the caller.


[Note: The InAttribute and OutAttribute are not required. In the absence of explicit settings, the system assumes that all arguments passed by reference are passed in /out and that all non-reference parameters are in . The only exception is the StringBuilder class, which is always assumed to be in /out . The InAttribute and OutAttribute are particularly useful when applied to formatted types that cannot be block-copied. Since these types require copying during marshaling, you can use InAttribute and OutAttribute to eliminate the generation of unnecessary copies.]

Compilers are required to not preserve this type in metadata as a custom attribute. Instead, compilers are required to emit it directly in the file format, as described in Partition II of the CLI Specification. Metadata consumers, such as the Reflection API, are required to retrieve this data from the file format and return it as if it were a custom attribute.


AttributeUsageAttribute(AttributeTargets.Parameter, AllowMultiple=false, Inherited=false)

See Also

System.Runtime.InteropServices Namespace


OutAttribute Constructors

OutAttribute Constructor

OutAttribute Constructor

public OutAttribute();


Constructs and initializes a new instance of the OutAttribute class.

See Also

System.Runtime.InteropServices.OutAttribute Class, System.Runtime.InteropServices Namespace