dotnet-native-marshaling - P/Invoke marshaling between C# and C++ Engine
Manage P/Invoke marshaling between C# and C++ Engine
Tags
Updated: 2026-02-13Capabilities
Typical Inputs
Typical Outputs
What this skill does
- Define NativeBindings
- Handle unsafe pointers
- Bridge libengine.so
- Map C++ types to C#
- Implement DllImport functions
- Create type-safe wrappers
Inputs
- libengine.so
- engine.dll
- interop_api.h header
- Type mapping definitions
- C++ function signatures
- Memory layout specifications
Outputs
- NativeBindings.cs files
- Marshaled structs
- Type-safe wrapper classes
- DllImport declarations
- Memory allocation wrappers
Requirements
- Linux or Windows OS
- NativeLibrary.SetDllImportResolver
- [StructLayout(LayoutKind.Sequential)]
- [MarshalAs] attributes
- CallingConvention.Cdecl
- C++/CLI interop capability
