Loading managed dll into AppDomain from native c++ code

允我心安 提交于 2019-12-11 03:47:28

问题


I want to load managed assembly into the AppDomain from native c++ code.
If it worth something the native code is a CLR profiler so I get notification each time AppDomain is created.


回答1:


I believe you need to host CLR.




回答2:


You're probably looking for ICLRRuntimeHost::ExecuteInDefaultAppDomain(). It will load an assembly into the default AppDomain. You asked about loading into "the" AppDomain, so presumably you don't care about other non-default AppDomains.

ICLRRuntimeHost is a COM interface, and thus available to native code.



来源:https://stackoverflow.com/questions/2216551/loading-managed-dll-into-appdomain-from-native-c-code

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!