Type.Assembly 속성

형식이 선언되는 Assembly를 가져옵니다. 제네릭 형식의 경우 제네릭 형식이 정의되는 Assembly를 가져옵니다.

네임스페이스: System
어셈블리: mscorlib(mscorlib.dll)

구문

‘선언
Public MustOverride ReadOnly Property Assembly As Assembly
‘사용 방법
Dim instance As Type
Dim value As Assembly

value = instance.Assembly
public abstract Assembly Assembly { get; }
public:
virtual property Assembly^ Assembly {
    Assembly^ get () abstract;
}
/** @property */
public abstract Assembly get_Assembly ()
public abstract function get Assembly () : Assembly

속성 값

현재 형식이 포함된 어셈블리를 설명하는 Assembly 인스턴스입니다. 제네릭 형식의 경우 인스턴스는 특정한 생성된 형식을 만들고 사용하는 어셈블리가 아니라 제네릭 형식 정의가 포함된 어셈블리를 설명합니다.

설명

현재 Type 개체가 생성된 제네릭 형식을 나타내는 경우 이 속성은 제네릭 형식 정의가 포함된 어셈블리를 반환합니다. 예를 들어, 제네릭 형식 정의 MyGenericStack<T>(Visual Basic의 경우 MyGenericStack(Of T), C++의 경우 generic<T> ref class MyGenericStack)이 포함된 MyGenerics.dll이라는 어셈블리를 만든다고 가정합니다. 다른 어셈블리에서 MyGenericStack<int>(Visual Basic의 경우 MyGenericStack(Of Integer))의 인스턴스를 만들면 생성된 형식의 Assembly 속성은 MyGenerics.dll을 나타내는 Assembly 개체를 반환합니다.

마찬가지로, 현재 Type 개체가 할당되지 않은 제네릭 매개 변수 T를 나타내는 경우 이 속성은 T를 정의하는 제네릭 형식이 포함된 어셈블리를 반환합니다.

이 속성은 읽기 전용입니다.

예제

다음 예제에서는 클래스와 관련된 어셈블리 이름과 형식의 정규화된 이름을 표시합니다.

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
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()); 
    }
}
using namespace System;
using namespace System::Reflection;
int main()
{
   Type^ objType = System::Array::typeid;
   
   // Print the full assembly name.
   Console::WriteLine( "Full assembly name: {0}.", objType->Assembly->FullName );
   
   // Print the qualified assembly name.
   Console::WriteLine( "Qualified assembly name: {0}.", objType->AssemblyQualifiedName );
}
import System.*;
import System.Reflection.*;

class MyAssemblyClass
{
    public static void main(String[] args)
    {
        Type objType = System.Array.class.ToType();
        // Print the full assembly name.
        Console.WriteLine("Full assembly name: {0}.",
            objType.get_Assembly().get_FullName().ToString());
        // Print the qualified assembly name.
        Console.WriteLine("Qualified assembly name: {0}.",
            objType.get_AssemblyQualifiedName().ToString());
    } //main
} //MyAssemblyClass

플랫폼

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework에서 모든 플래폼의 모든 버전을 지원하지는 않습니다. 지원되는 버전의 목록은 시스템 요구 사항을 참조하십시오.

버전 정보

.NET Framework

2.0, 1.1, 1.0에서 지원

.NET Compact Framework

2.0, 1.0에서 지원

참고 항목

참조

Type 클래스
Type 멤버
System 네임스페이스