问题
Is there a way to host the .NET CLR runtime and register MethodImplOptions.InternalCall functions? (This is not a topic about P/Invoke)
回答1:
SSCLI code (specifically clr\src\vm\ecall.cpp) suggests that there is no way to register InternalCall methods, because the crucial gECClasses table is hardcoded.
回答2:
IMetaDataImport is your best bet, but can't really vouch for that. This seems like a specific task for C++/CLI.
来源:https://stackoverflow.com/questions/1317861/net-clr-internalcall