//The native wrapper: static int ast_mono_wrapper_ast_cli_command(int fd, MonoString * s) { char *s_charptr = mono_string_to_utf8(s); int retval = ast_cli_command(fd, s_charptr); g_free(s_charptr); // PASSBYREF? -- FREEIT? return retval; } // The wireup mono_add_internal_call("Telefinity.ManagedAsterisk.Core.Cli.Native::ast_cli_command", ast_mono_wrapper_ast_cli_command); // In my Cli.Native.cs class: [MethodImplAttribute(MethodImplOptions.InternalCall)] internal extern static int ast_cli_command(int fd, string s); // And then as part of the Cli object: public int Command(int fd, string s) { return Cli.Native.ast_cli_command(fd, s); }