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

API Browser

Class

NativeImportAttribute

class NativeImportAttribute

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

Inheritance: Object → Attribute → NativeImportAttribute

Binds an extern static method or namespace function to an exact native export. Library loading and symbol resolution occur on first invocation. The declaration must match the actual native ABI; metadata cannot prove the export's signature.

Constructors

1 item
NativeImportAttribute(libraryName: string) Records a native library loader name or path. Does not load native code.

Properties

4 items
CallingConvention: NativeCallingConvention Selects the platform C calling convention.
EntryPoint: string Selects an exact export name; omission uses the declared function name.
LibraryName: string Gets the native library loader name or path.
StringMarshalling: NativeStringMarshalling Selects input string encoding; None rejects String parameters. Buffers cannot be retained, modified, freed or returned by native code.

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