如何读取程序集清单,而无需加载该.dll [英] how to read the assembly manifest without loading the .dll

查看:117
本文介绍了如何读取程序集清单,而无需加载该.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.

这篇关于如何读取程序集清单,而无需加载该.dll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆