System.Runtime.InteropServices.InAttribute Class

public sealed class InAttribute : Attribute

Base Types







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


[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


InAttribute Constructors

InAttribute Constructor

InAttribute Constructor

public InAttribute();


Constructs and initializes a new instance of the InAttribute class.

See Also

System.Runtime.InteropServices.InAttribute Class, System.Runtime.InteropServices Namespace