简体   繁体   English

从本机C ++代码将托管dll加载到AppDomain中

[英]Loading managed dll into AppDomain from native c++ code

I want to load managed assembly into the AppDomain from native c++ code. 我想从本地c ++代码将托管程序集加载到AppDomain中。
If it worth something the native code is a CLR profiler so I get notification each time AppDomain is created. 如果值得的话,本机代码是CLR分析器,因此每次创建AppDomain时都会收到通知。

我相信您需要托管CLR

You're probably looking for ICLRRuntimeHost::ExecuteInDefaultAppDomain() . 您可能正在寻找ICLRRuntimeHost::ExecuteInDefaultAppDomain() It will load an assembly into the default AppDomain. 它将程序集加载到默认的 AppDomain中。 You asked about loading into "the" AppDomain, so presumably you don't care about other non-default AppDomains. 您询问是否要加载到“ the” AppDomain中,所以大概您不关心其他非默认AppDomain。

ICLRRuntimeHost is a COM interface, and thus available to native code. ICLRRuntimeHost是一个COM接口,因此可用于本机代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM