Loading Mixed-Mode C++/CLI .dll (and dependencies) dynamically from unmanaged c++

后端 未结 2 1683
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-03 03:59

I have a managed C++ assembly I\'m loading dynamically in an unmanaged c++ application through a standard LoadLibrary() call. The managed C++ assembly has dependencies on se

2条回答
  •  一生所求
    2021-01-03 04:41

    The CLR gets loaded in an unusual way in this scenario, through a thunk that the compiler injected when compiling the native export for __declspec(dllexport). Doing this is fine, it just isn't particularly fast.

    The CLR will go out hunting for a .config file to initialize the primary AppDomain. And will look for MyCoolApp.exe.config, regardless that this is not a managed executable at all. You can use the element to add subdirectories to search for assemblies.

提交回复
热议问题