Skip to content

MarshalDirectiveException : Method's type signature is not PInvoke compatible. #2

@jrouaix

Description

@jrouaix

Well, i'm having troubles with FFI on netcoreapp2 vs all good on netcoreapp3

image

[DllImport(LIB_NAME, CharSet = CharSet.Ansi)]
public static extern FFIExecResult ffi_exec_expr(FFIExpressionHandle ptr, FFIIdentifierKeyValue[] identifier_values, UIntPtr identifier_values_len);

I narrowed the problem to the function return type :

[StructLayout(LayoutKind.Sequential)]
internal unsafe struct FFIExecResult
{
    [MarshalAs(UnmanagedType.I1)]
    public bool is_error;
    public IntPtr content;

    public FFIStringHandle GetContent() => new FFIStringHandle(content);
}

Is there some other way to hack through this on netcore2 ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions