Development · Native API migration preview · Coverage validation in progress Published release →

API Browser

Class

MarshalAsAttribute

class MarshalAsAttribute

Module: System.Runtime.InteropServices
Assembly: System.Runtime.dll
Source file: NativeImportAttribute.rvn

Inheritance: Object → Attribute → MarshalAsAttribute

Overrides the native representation of one parameter, result or native struct field. Field overrides currently support Boolean Bool8/Bool32 storage in native-library layouts; they do not automatically marshal managed struct instances. Strings are input-only; Bool8 and Bool32 normalize false/true to 0/1 on input and treat every nonzero native result as true.

Constructors

1 item
MarshalAsAttribute(nativeType: NativeType) Records a conversion descriptor. Does not allocate or invoke native code.

Properties

1 item
Value: NativeType Gets the selected native representation.

Methods

4 items
Equals(other: object?) -> bool Tests reference identity by default; an ordinary class may override equality. Inherited from Object.Equals
GetHashCode() -> int Returns a stable identity hash by default; an ordinary class may override it consistently with equality. Inherited from Object.GetHashCode
GetType() -> TypeInfo Returns metadata for the concrete runtime type of this instance. Inherited from Object.GetType
ToString() -> string Returns the concrete runtime type name for supported references, or display text from a class or boxed-struct override. Inherited from Object.ToString