Pretty much what the question states. I have a .net exe that runs, and then loads my library (in c++). Is there any way to get the ICLRMetaHost, or similar interface, that mscoree loads when it starts up the .net exe? I want to do this primarily so I can access the gc and memory related settings from my native library for debugging purposes.
Bonus points for point out a similar implementation using the mono hosting api.
I don't see why the normal way of obtaining
ICLRMetaHost
wouldn't work from within a DLL that's been loaded by the CLR...CLRCreateInstance
.CLRCreateInstance
as shown here to get hold ofICLRMetaHost
.EnumerateLoadedRuntimes
and hope that there's only one loaded...ICLRRuntimeHost
.ICLRRuntimeHost
obtainICLRControl
ICLRControl
obtainICLRGCManager