Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Assembly.GetExportedTypes vs GetTypes

Tags:

What does Assembly.GetExportedTypes() do? How is it different from Assembly.GetTypes()

Can you explain with example?

like image 628
Viks Avatar asked Feb 11 '09 16:02

Viks


2 Answers

GetExportedTypes() does not include protected/private/internal types. As per the question linked in Alexander's question below, internal types are not included even if would be visible to an assembly via InternalsVisibleToAttribute.

GetTypes() includes all types.

like image 85
Richard Szalay Avatar answered Sep 21 '22 17:09

Richard Szalay


GetExportedTypes() returns only types which are visible outside the assembly in question. "Visible" means public types and public types nested within other public types.

like image 40
Anton Gogolev Avatar answered Sep 21 '22 17:09

Anton Gogolev