C# Type Assembly
Description
Type Assembly
gets the Assembly in which the type is declared.
For generic types, gets the Assembly in which the generic type is defined.
Syntax
Type.Assembly
has the following syntax.
public abstract Assembly Assembly { get; }
Example
The following example displays the assembly name associated with the class and the fully qualified name of the type.
using System;/* ww w. j a v a 2 s . c o m*/
using System.Reflection;
class MyAssemblyClass
{
public static void Main()
{
Type objType = typeof(System.Array);
// Print the full assembly name.
Console.WriteLine ("Full assembly name:\n {0}.",
objType.Assembly.FullName.ToString());
// Print the qualified assembly name.
Console.WriteLine ("Qualified assembly name:\n {0}.",
objType.AssemblyQualifiedName.ToString());
}
}
The code above generates the following result.