Используйте DllImport __Internal
для вызова собственных методов в хосте.
Пример:
[DllImport("__Internal")]
public static extern void mono_threads_request_thread_dump();
public static void Main(string[] args)
{
mono_threads_request_thread_dump();
Console.WriteLine("Hello World!");
}
Вывод:
Full thread dump:
"<unnamed thread>" at <unknown> <0xffffffff>
at Console_ThreadDump.MainClass.Main (string[]) [0x00007] in /Volumes/Code/code/Projects/Console_ThreadDump/Console_ThreadDump/Program.cs:14
at (wrapper runtime-invoke) <Module>.runtime_invoke_void_object (object,intptr,intptr,intptr) [0x00051] in <e3877a65d90742cebc8141de4055f006>:0
"Debugger agent"
"Finalizer"Hello World!
Press any key to continue...