how to unload managed c++ dll?

2019-02-20 17:04发布

问题:

A.dll is a native c++ dll, B.dll is a managed c++ dll. A.dll depends on B.dll, so when load A.dll, B.dll is loaded automatically, but after A.dll is unloaded, B.dll is still loaded. Only A.dll depends on B.dll, why B.dll can't be unloaded? How to unload the managed c++ dll? I'm using vs2010.

Thanks

回答1:

You cannot unload a managed assembly once it is loaded by the CLR. The only way is to kill the AppDomain.