如何获取程序集中具有未解决的依赖关系的类型列表?

发布于 2025-01-05 20:26:02 字数 308 浏览 4 评论 0原文

我想列出 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

谁对谁错谁最难过 2025-01-12 20:26:02

对于完整的 .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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文