Expand Minimize

Type.FullName Property

Gets the fully qualified name of the type, including its namespace but not its assembly.

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

'Declaration
Public MustOverride ReadOnly Property FullName As String

Property Value

Type: System.String
The fully qualified name of the type, including its namespace but not its assembly; or Nothing if the current instance represents a generic type parameter, an array type, pointer type, or byref type based on a type parameter, or a generic type that is not a generic type definition but contains unresolved type parameters.

Implements

_Type.FullName

For example, the fully qualified name of the String type is System.String. Contrast this with the assembly-qualified name returned by the AssemblyQualifiedName property, which consists of the full name plus the full assembly name.

If the current type represents a closed generic type, the type arguments in the string returned by the FullName property are qualified by their full assembly name, even though the string representation of the generic type itself is not qualified by its full assembly name. The following example illustrates the difference in the FullName property for a type that represents generic type definition and one that represents a closed generic type.

Imports System.Collections.Generic

Module Example
   Public Sub Main()
      Dim t As Type = GetType(List(Of))
      Console.WriteLine(t.FullName)
      Console.WriteLine()

      Dim list As New List(Of String)()
      t = list.GetType()
      Console.WriteLine(t.FullName)
   End Sub 
End Module 
' The example displays the following output: 
'    System.Collections.Generic.List`1 

'    System.Collections.Generic.List`1[[System.String, mscorlib, 
'             Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]

If the current Type represents a type parameter of a generic type, or an array type, pointer type, or byref type based on a type parameter, this property returns Nothing.

If the current type contains generic type parameters that have not been replaced by specific types (that is, the ContainsGenericParameters property returns true), but the type is not a generic type definition (that is, the IsGenericTypeDefinition property returns false), this property returns Nothing. For example, consider the classes Base and Derived in the following code.

Public Class Base(Of TBase)
End Class 
Public Class Derived(Of TDerived)
    Inherits Base(Of TDerived)
End Class

If you use the BaseType property to obtain the base type of Derived, the FullName property of the resulting Type object returns Nothing. To get a non-null FullName, you can use the GetGenericTypeDefinition method to get the generic type definition.

This property is read-only.

The following example displays the full name of the specified type.

Imports System

Class TestFullName

    Public Shared Sub Main()
        Dim t As Type = GetType(Array)
        Console.WriteLine("The full name of the Array type is {0}.", t.FullName)
    End Sub 'Main
End Class 'TestFullName

' This example produces the following output: 

'The full name of the Array type is System.Array. 
'

.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

XNA Framework

Supported in: 3.0, 2.0, 1.0

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
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft