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)

abstract FullName : string with get

Property Value

Type: System.String

The fully qualified name of the type, including its namespace but not its assembly; or null 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 FullNameproperty 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.

No code example is currently available or this language may not be supported.

This property returns null if:

  • The current Type object represents a type parameter of a generic type.

    The following example retrieves the type parameter of the Nullable<'T> type and attempts to display its FullName property.

    No code example is currently available or this language may not be supported.
  • The current Type object represents an array type, a pointer type, or a byref type that is based on a generic type parameter.

    The following example defines a generic type, Generictype1<T>, with three methods: Display(T[]), which is passed an array of type T; HandleT(T), which is passed a T object; and ChangeValue(ref T), which is passed a T object by reference. Because C# and Visual Basic do not allow us to define T as a pointer in the HandleT method, we have to call the MakePointerType method on the Type object that represents the method's parameter type to create a pointer to a generic type. The output from the example shows that in all three cases, the FullName property is null.

    No code example is currently available or this language may not be supported.
  • 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

    In the following example, Derived<T> inherits from Base<T>. The BaseType property obtains the Type object that represents the base type of Derived<T>, and its FullName property returns null.

    No code example is currently available or this language may not be supported.

    To get a FullName that is not null, you can use the GetGenericTypeDefinition method to get the generic type definition, as the example illustrates.

This property is read-only.

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

No code example is currently available or this language may not be supported.

The following example compares the strings returned by the ToString method and the Name, FullName, and AssemblyQualifiedName properties.

No code example is currently available or this language may not be supported.

Universal Windows Platform
Available since 8
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Return to top
Show: