是内部的类型从Assembly.GetExportedTypes可见的()? [英] Are internal types visible from Assembly.GetExportedTypes()?

查看:411
本文介绍了是内部的类型从Assembly.GetExportedTypes可见的()?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:
  <一href="http://stackoverflow.com/questions/537548/assembly-getexportedtypes-vs-gettypes">Assembly.GetExportedTypes VS GetTypes

是内部类型可见,当调用了 Assembly.GetExportedTypes()?如果没有,那么就被打了电话从装配与 InternalsVisibleToAttribute 改变行为?

Are internal types visible when a call is made to Assembly.GetExportedTypes()? If not, then does the call being made from an assembly with an InternalsVisibleToAttribute change the behavior?

推荐答案

GetTypes 返回程序集中的所有类型,同时 GetExportedTypes 返回类型标记为public,即:

GetTypes returns all the types in the assembly while GetExportedTypes returns only the types marked as public, i.e.:

public class A

将由这两种方法被返回

would be returned by both methods

class B

将仅由 GetExportedTypes

这篇关于是内部的类型从Assembly.GetExportedTypes可见的()?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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