Export (0) Print
Expand All

Assembly.GetExportedTypes Method

Gets the public types defined in this assembly that are visible outside the assembly.

Namespace:  System.Reflection
Assembly:  mscorlib (in mscorlib.dll)

'Declaration
Public Overridable Function GetExportedTypes As Type()

Return Value

Type: System.Type()
An array that represents the types defined in this assembly that are visible outside the assembly.

Implements

_Assembly.GetExportedTypes

ExceptionCondition
NotSupportedException

The assembly is a dynamic assembly.

The only types visible outside an assembly are public types and public types nested within other public types.

The following code sample defines a number of classes with various access levels, and calls GetExportedTypes to display the ones that are visible from outside the assembly.

Imports System
Imports System.Reflection

Public Class Example
    Public Shared Sub Main()
        For Each t As Type In GetType(Example).Assembly.GetExportedTypes()
            Console.WriteLine(t)
        Next 
    End Sub 
End Class 

Public Class PublicClass
    Public Class PublicNestedClass
    End Class 

    Protected Class ProtectedNestedClass
    End Class 

    Friend Class FriendNestedClass
    End Class 

    Private Class PrivateNestedClass
    End Class 
End Class 

Friend Class FriendClass
    Public Class PublicNestedClass
    End Class 

    Protected Class ProtectedNestedClass
    End Class 

    Friend Class FriendNestedClass
    End Class 

    Private Class PrivateNestedClass
    End Class 
End Class

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Portable Class Library

Supported in: Portable Class Library

Supported in: Windows Phone 8.1

Supported in: Windows Phone Silverlight 8.1

Supported in: Windows Phone Silverlight 8
Show:
© 2015 Microsoft