可能重复: 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