如何获取程序集中具有未解决的依赖关系的类型列表?
我想列出 DLL(程序集)中提到的所有类型,这些类型与我无权访问的其他 DLL 有一些依赖关系。
有没有办法消除这些依赖关系并只获取可用类型和类的名称?
使用 Assembly.Load("程序集全名") 函数我可以加载程序集,但是当我尝试使用 Assembly.GetTypes() 获取类型时,出现以下错误:
“无法加载一种或多种请求的类型。检索 LoaderExceptions 属性以获取更多信息。”
顺便说一句,我在 silverlight 中完成了这一切,尽管我在 .net 和 silverlight 中都遇到了这个错误。
I want to list down all the types mentioned in a DLL(assembly) which has some dependencies to other DLLs that I don't have access to.
Is there a way to dismiss those dependencies and just get the name of the available types and classes?
Using Assembly.Load("assembly full name") function I can load the assembly, but when I try to get the types using Assembly.GetTypes() I get the following error:
"Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information."
BTW, I'm doing this all in silverlight, though I get this error both in .net and silverlight.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于完整的 .NET 客户端,您需要在仅反射上下文中加载程序集: http://msdn.microsoft.com/en-us/library/0et80c7k.aspx
不过,Silverlight 本身似乎没有这种方法。
For a full .NET client you would need to load the assembly in a reflection only context: http://msdn.microsoft.com/en-us/library/0et80c7k.aspx
It does not look like this method is in Silverlight itself though.