This documentation is archived and is not being maintained.
Type.Assembly Property
.NET Framework 1.1
Gets the Assembly that the type is declared in.
[Visual Basic] Public MustOverride ReadOnly Property Assembly As Assembly [C#] public abstract Assembly Assembly {get;} [C++] public: __property virtual Assembly* get_Assembly() = 0; [JScript] public abstract function get Assembly() : Assembly;
Property Value
An Assembly instance that describes assembly containing the current type.
Remarks
This property is read-only.
Example
[Visual Basic, C#, C++] The following example displays the assembly name associated with the class and the fully qualified name of the type.
[Visual Basic] Imports System Imports System.Reflection Imports Microsoft.VisualBasic Class MyAssemblyClass Public Shared Sub Main() Dim objType As Type = GetType(System.Array) ' Print the full assembly name. Console.WriteLine("Full assembly name: {0}.", objType.Assembly.FullName.ToString()) ' Print the qualified assembly name. Console.WriteLine("Qualified assembly name: {0}.", objType.AssemblyQualifiedName.ToString()) End Sub 'Main End Class 'MyAssemblyClass [C#] using System; using System.Reflection; class MyAssemblyClass { public static void Main() { Type objType = typeof(System.Array); // Print the full assembly name. Console.WriteLine ("Full assembly name: {0}.", objType.Assembly.FullName.ToString()); // Print the qualified assembly name. Console.WriteLine ("Qualified assembly name: {0}.", objType.AssemblyQualifiedName.ToString()); } } [C++] #using <mscorlib.dll> using namespace System; using namespace System::Reflection; int main() { Type* objType = __typeof(System::Array); // Print the full assembly name. Console::WriteLine (S"Full assembly name: {0}.", objType->Assembly->FullName); // Print the qualified assembly name. Console::WriteLine (S"Qualified assembly name: {0}.", objType->AssemblyQualifiedName); }
[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button
in the upper-left corner of the page.
Requirements
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework, Common Language Infrastructure (CLI) Standard
See Also
Show: