Gets the fully qualified name of the type represented by the current instance including the name of the assembly from which the Type was loaded.
The assembly-qualified name of the Type, including the name of the assembly from which the Type was loaded. If the current Type object represents a generic parameter, this property returns null.
Operation
This property is read-only.
Compilers emit the simple name of a nested class, and reflection constructs a mangled name when queried, in accordance with the following conventions.
Delimiter Meaning Backslash (\) Escape character. Comma (,) Precedes the Assembly name. Plus sign (+) Precedes a nested class. Period (.) Denotes namespace identifiers. Square brackets ([]) After a type name, denotes an array of that type.
-or-
For a generic type, encloses the entire generic type argument list.
-or-
Within a type argument list, encloses an assembly-qualified type.
Note:For example, the fully qualified name for a class might look like this:
TopNamespace.SubNameSpace.ContainingClass+NestedClass,MyAssembly
If the namespace were TopNamespace.Sub+Namespace, then the string would have to precede the plus sign (+) with an escape character (\) to prevent it from being interpreted as a nesting separator. Reflection emits this string as follows:
TopNamespace.Sub\+Namespace.ContainingClass+NestedClass,MyAssembly
A "++" becomes "\+\+", and a "\" becomes "\\".
Type names are permitted to include trailing characters that denote additional information about the type, such as whether the type is a reference type, a pointer type or an array type. To retrieve the type name without these trailing characters, use t.GetElementType().ToString(), where t is the type.
Spaces are significant in all type name components except the assembly name. In the assembly name, spaces before the ',' separator are significant, but spaces after the ',' separator are ignored.
Generic arguments of generic types are themselves fully qualified. For example, the output from the following C# program, if compiled to an assembly called Try64
Example
using System; using System.Reflection; class MyTest { public static void Main(String[] args) { Type b = typeof(B<string,object>); Console.WriteLine(b.AssemblyQualifiedName); } } public class B<T,U> { }is as follows:
Example
B`2[[System.String, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.Object, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], Try64, Version=0.0.0.0, Culture=neutral, PublicKeyToken=nullUsage
The name returned by this method can be persisted and later used to load the Type. To search for and load a Type, use Type.GetType(string, bool, bool) either with the type name only or with the assembly qualified type name. Type.GetType(string, bool, bool) with the type name only will look for the Type in the caller's assembly and then in the System assembly. Type.GetType(string, bool, bool) with the assembly qualified type name will look for the Type in any assembly.
Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0