C# TypeInfo Assembly

Description

TypeInfo Assembly Gets the Assembly in which the type is declared. For generic types, gets the Assembly in which the generic type is defined.

Syntax

TypeInfo.Assembly has the following syntax.


public abstract Assembly Assembly { get; }

Example


using System;//from w ww .j a  va 2  s  . com
using System.Reflection;

class MyAssemblyClass
{
    public static void Main()
    {
        Type objType = typeof(System.Array);
        Console.WriteLine ("Full assembly name:\n   {0}.", 
                           objType.Assembly.FullName.ToString()); 

        Console.WriteLine ("Qualified assembly name:\n   {0}.", 
                           objType.AssemblyQualifiedName.ToString()); 
    }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System.Reflection »




EventInfo
FieldInfo
MemberInfo
MethodInfo
ParameterInfo
TypeInfo