如何读取程序集清单,而无需加载该.dll
从本质上需要阅读的依赖编程而不加载组件本身,那么你就不能卸载它们
Essentially need to read the dependencies programmatically without loading the assembly itself, as then you can't unload them
2的解决方案来我的心,但我认为还有更简单的方法(我忘记或不知道:)):
1.使用一些额外的的AppDomain
,您可以创建装入组件。卸载整个 AddDomain
也将卸载加载的程序集(但只有那些,它采用加载此的AppDomain
)。
2.使用一些API,比如 CCI ,让你看看里面管理的DLL不使用加载反射机制。
2 solutions come to my mind, although I think there's easier way (which I forgot or don't know :) ):
1. Load your assemblies using some additional AppDomain
that you can create. Unloading whole AddDomain
will also unload loaded assemblies (but only those, which were loaded using this AppDomain
).
2. Use some api, for example CCI that allows you to look inside managed dll's without loading it using reflection mechanism.